Another observation is

what works
@Result(name = ComposeMessageCrudAction.REDIRECT_TO, location =
"/customerhome.do?custIdId=200", type = "redirect") })


what does not work
@Result(name = "redirectTo", location = "#parameters.redirectLocation",
type = "redirect") })

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

*i am not getting why second approach is not working and why its adding
customer namespace before *
*/customerhome.do?custIdId=200*


On Wed, Sep 11, 2013 at 8:54 PM, Mohit Gupta <motgu...@gmail.com> wrote:

> params={"namespace", "/"}  did not help. Still it adds the customer
> namespace
>
>
> On Wed, Sep 11, 2013 at 8:40 PM, Christoph Nenning <
> christoph.nenn...@lex-com.net> wrote:
>
>> it should work when you add namespace "/" to paramters:
>>
>> @Result(
>>         name = "redirectTo",
>>         location = "#parameters.redirectLocation",
>>         type = "redirect",
>>         params={"namespace", "/"}
>> )
>>
>>
>> see this wiki page:
>> http://struts.apache.org/development/2.x/docs/redirect-result.html
>>
>>
>> Regards,
>> Christoph
>>
>>
>>
>> >
>> > 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?
>>
>> This Email was scanned by Sophos Anti Virus
>>
>
>

Reply via email to