You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Struts User <sm...@gmail.com> on 2010/08/24 00:01:42 UTC
redirect with parameter in struts
Hi,
Is it possible in struts1 to include a parameter in the action redirection.
If I have a web application say, http://www..xyz.com/welcome.do and I want
to redirect it to http://www.xyz.com/welcomeredirect.do?cmp=company1 while
value of "cmp" will be assigned dynamically. how can I achieve this? Any
help or suggestion is greatly appreciated.
Thanks
Re: redirect with parameter in struts
Posted by Robert Taylor <rt...@dtgresults.com>.
Another possible way is to leverage the ActionRedirect class.
For example:
ActionRedirect redirect = new
ActionRedirect(mapping.findForward("someRedirectingForwardDef"));
redirect.addParameter("cmp", companyName);
redirect.addParameter("myOtherParameter", myOtherParameterValue);
return redirect;
The framework takes care of building the query string, encoding, etc...
/robert
----- Original Message -----
From: "Struts User" <sm...@gmail.com>
To: <us...@struts.apache.org>
Sent: Monday, August 23, 2010 6:01 PM
Subject: redirect with parameter in struts
> Hi,
>
> Is it possible in struts1 to include a parameter in the action
> redirection.
> If I have a web application say, http://www..xyz.com/welcome.do and I want
> to redirect it to http://www.xyz.com/welcomeredirect.do?cmp=company1 while
> value of "cmp" will be assigned dynamically. how can I achieve this? Any
> help or suggestion is greatly appreciated.
>
> Thanks
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: redirect with parameter in struts
Posted by Paweł Wielgus <po...@gmail.com>.
Hi,
one possible way is:
return new ActionForward("/orderWrapper.do?actionTarget=VIEW_CUSTOMER", true);
inside a execute action method.
Best greetings,
Paweł Wielgus.
2010/8/24 Struts User <sm...@gmail.com>:
> Hi,
>
> Is it possible in struts1 to include a parameter in the action redirection.
> If I have a web application say, http://www..xyz.com/welcome.do and I want
> to redirect it to http://www.xyz.com/welcomeredirect.do?cmp=company1 while
> value of "cmp" will be assigned dynamically. how can I achieve this? Any
> help or suggestion is greatly appreciated.
>
> Thanks
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org