Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Pass url back to redirect action?

Laurie Harper

2007-02-26

Replies:

Neil Aggarwal wrote:
> Hello:
>
> In my struts.xml, I have this:
>
>  <action name="*/*" class="{1}.{2}">
>   <result name="input">/{1}/{2}.jsp</result>
>   <result name="login">/top/Login.jsp</result>
>   <result name="loginRedirect" type="redirect">
>  <param
> name="location">https://tweb.retcgroup.com/thymeleweb/top/Login.action</para
> m>
>   </result>
>   <result name="success">/{1}/{2}.jsp</result>
>  </action>
>
> I would like to have the URL for the loginRedirect result
> passed back from my Login class.
>
> Is there a way to do that?
>
> Thanks,
>  Neil

I believe you can do this, or something similar (assuming the URL is
available via a getRedirectUrl() method on your action):

 <result name="loginRedirect" type="redirect">${redirectUrl}</result>

Note that it's ${...} not %{...}.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.