struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sachin Mehrotra <sachin.mehro...@outlook.com>
Subject RE: Redirecting to legacy action from struts 2 action ?
Date Wed, 11 Sep 2013 15:16:18 GMT
The application context inside ur CustomerAction is /myWebApp/customer, that us why it is using
this. You can add root app as name space parameter in Result.

Sachin
Sent from my Windows Phone
________________________________
From: Mohit Gupta<mailto:motgupta@gmail.com>
Sent: ‎11-‎09-‎2013 08:32 PM
To: Struts Users Mailing List<mailto:user@struts.apache.org>
Subject: Redirecting to legacy action from struts 2 action ?

Hi All,

i have struts 2 action named as CustomerAction.java which is under
 folderHierarchy/actions/customer(customer is namespace here). From one of
the method
inside this action class, I am redirecting to my legacy action class

ResultMapping is :-
@Result(name = "redirectTo", location = "#parameters.redirectLocation",
type = "redirect") })

where #parameters.redirectLocation is /customerhome.do?custIdId=200

Action method is :-
 @Action(value = "CustomerAction!redirectToPage")
  public String redirectToLocation() {
    return "redirectTo";
  }

 But issue is struts auotomatically adding current action namespace(i.e
customer) before redirection location. So instead of
redirecting to/myWebApp/customerhome.do?custIdId=200, struts 2 is
redirecting to /myWebApp/customer/customerhome.do?custIdId=200 and i am
getting exception
HTTP Status: 404, Problem URI: /myWebApp/customer/


I am not getting why its adding cuustomer namespace and how to get rid of
this?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message