You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Piero Sartini <li...@pierosartini.de> on 2007/08/03 05:30:44 UTC

Is it possible to pass a dynamic parameter to a redirectAction?

I have the following situation:
a searchfield is on top of a table presenting results. if there is only one 
result, the user should be redirected without the need of clicking on the 
list..

now my problem is how to redirect to an action and passing a parameter from 
within my original action..

I am working around this by putting the ID information into the user 
session ... but I am sure there is a cleaner way of doing this ;)

Piero

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is it possible to pass a dynamic parameter to a redirectAction?

Posted by Dale Newfield <Da...@Newfield.org>.
Piero Sartini wrote:
> I have the following situation:
> a searchfield is on top of a table presenting results. if there is only one 
> result, the user should be redirected without the need of clicking on the 
> list..

If you just want them to see the list for X seconds, then the link to be 
followed, put this in the <head> section of the resulting page:

<meta http-equiv="refresh" content="60;url=<s:url includeParams="get"/>"/>

Of course, you'll want a different value for that s:url tag, but only 
you know that value.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is it possible to pass a dynamic parameter to a redirectAction?

Posted by Laurie Harper <la...@holoweb.net>.
Piero Sartini wrote:
> I have the following situation:
> a searchfield is on top of a table presenting results. if there is only one 
> result, the user should be redirected without the need of clicking on the 
> list..
> 
> now my problem is how to redirect to an action and passing a parameter from 
> within my original action..
> 
> I am working around this by putting the ID information into the user 
> session ... but I am sure there is a cleaner way of doing this ;)

You can pass the parameter through the action mapping. For example:

   <action name="..." ...>
     <result ...>/redirect/to/here?param=${rowId}</result>
   </action>

and add a getRowId() method to the associated action class.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is it possible to pass a dynamic parameter to a redirectAction?

Posted by Joe Lam <jo...@moni-media.net>.
This might help

http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect
http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect 



Piero Sartini-3 wrote:
> 
> I have the following situation:
> a searchfield is on top of a table presenting results. if there is only
> one 
> result, the user should be redirected without the need of clicking on the 
> list..
> 
> now my problem is how to redirect to an action and passing a parameter
> from 
> within my original action..
> 
> I am working around this by putting the ID information into the user 
> session ... but I am sure there is a cleaner way of doing this ;)
> 
> Piero
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-it-possible-to-pass-a-dynamic-parameter-to-a-redirectAction--tf4210445.html#a12010357
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org