struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Forchel <>
Subject Re: redirect
Date Tue, 09 Dec 2008 07:26:46 GMT

Aditya Lukman wrote:
> Hi all,,
> i want to redirect from http://localhost:8080/cimeng/adhit *to*
> http://localhost:8080/cimeng/profile.action?nickname=aray
> so,, how to solve my problem
> please, give me a descriptions for my problem
> thank's for your help

Seems to be quite simple. In your struts.xml add the following (replace the

[action name="adhit" class=""]
   [result type="redirectAction"]
      [param name="actionName"]profile[/param]
      [param name="param1"]nickname[/param]
      [param name="param2"]${name}[/param]

[action name="profile" class=""]

Be aware of the difference of the result types in Struts 2.0.x
("redirect-action") and Struts 2.1 ("redirectAction"). In your AdhitAction
class you need a getter-method for the "name" property and in your
ProfileAction class a setter-method for your "nickname" property.
That's all. With OGNL the parameter name is dynamically added to the
redirect URL.

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message