You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Hubert Rabago <ja...@yahoo.com> on 2003/10/13 16:16:45 UTC

Params to redirects

> |  866|New|Enh|2001-03-06|Clean Way to Add
> Parameters to Redirecting Forward|

I recently joined the struts-dev list with the
intention of submitting code to support parameters for
redirects.  
I have been using redirect with parameters for all my
struts projects the past couple of years and
wanted to submit it for consideration for the next
release. 
It always had just enough features for whatever
project I was working on at the time so I'm still
trying to find the time to polish it to support
features that may already be expected.  In the 
meantime, I wanted to ask if there was a philosophy
that kept Struts from allowing redirect with
parameters or a limitation that kept it from being
acceptable.  I tried searching the mailing
list archives and have found little or no discussion
about it.



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


RE: Params to redirects

Posted by Hubert Rabago <ja...@yahoo.com>.
Before I do a redirect which requires parameters, 
I have a java class which I instantiate to provide
parameters.

RedirectParameters rp = new RedirectParameters();
rp.add("param1",myParam1String);
rp.add("param2",myIntParam);
rp.add("sameParamName",diffValue1);
rp.add("sameParamName",diffValue2);
rp.add("sameParamName",diffValue3);

I recently added support for adding an ActionError
and/or ActionMessage object.

The params are saved as a request attribute.  
In the RequestProcessor, 
I check if the ActionForward is for a redirect.
If it is and if this attribute is present,
I append the params to the redirect URL.

Wish I'd thought of adding it to ActionForward.
That would make the approach feel a lot cleaner.
On the other hand, that would have a bigger 
footprint either on the engine or on the 
Action returning the ActionForward for
thread safety, etc.  Not to mention saying goodbye to
the [ return mapping.findForward("myMapping"); ]
lines. =)

--- Andrew Hill <an...@gridnode.com>
wrote:
> Dunno what the committers and devs have to say about
> it, but I know Id find
> it highly useful. :-)
> Seem to spend half my life messing round with query
> parameters in urls to
> pass to ActionForward constructors inside an action!
> 
> So whats your code do?
> Add getters and setters to ActionForward class? Or
> allow one to specify a
> bean in the forward mapping in struts config to get
> params from which the
> requestprocessor will retrieve at run time once it
> gets the forward returned
> from the action?
> 
> Or both?
> 
> -----Original Message-----
> From: Hubert Rabago [mailto:jakartauser@yahoo.com]
> Sent: Monday, 13 October 2003 22:17
> To: Struts Developers List
> Subject: Params to redirects
> 
> 
> > |  866|New|Enh|2001-03-06|Clean Way to Add
> > Parameters to Redirecting Forward|
> 
> I recently joined the struts-dev list with the
> intention of submitting code to support parameters
> for
> redirects.
> I have been using redirect with parameters for all
> my
> struts projects the past couple of years and
> wanted to submit it for consideration for the next
> release.
> It always had just enough features for whatever
> project I was working on at the time so I'm still
> trying to find the time to polish it to support
> features that may already be expected.  In the
> meantime, I wanted to ask if there was a philosophy
> that kept Struts from allowing redirect with
> parameters or a limitation that kept it from being
> acceptable.  I tried searching the mailing
> list archives and have found little or no discussion
> about it.
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-dev-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


RE: Params to redirects

Posted by Andrew Hill <an...@gridnode.com>.
Dunno what the committers and devs have to say about it, but I know Id find
it highly useful. :-)
Seem to spend half my life messing round with query parameters in urls to
pass to ActionForward constructors inside an action!

So whats your code do?
Add getters and setters to ActionForward class? Or allow one to specify a
bean in the forward mapping in struts config to get params from which the
requestprocessor will retrieve at run time once it gets the forward returned
from the action?

Or both?

-----Original Message-----
From: Hubert Rabago [mailto:jakartauser@yahoo.com]
Sent: Monday, 13 October 2003 22:17
To: Struts Developers List
Subject: Params to redirects


> |  866|New|Enh|2001-03-06|Clean Way to Add
> Parameters to Redirecting Forward|

I recently joined the struts-dev list with the
intention of submitting code to support parameters for
redirects.
I have been using redirect with parameters for all my
struts projects the past couple of years and
wanted to submit it for consideration for the next
release.
It always had just enough features for whatever
project I was working on at the time so I'm still
trying to find the time to polish it to support
features that may already be expected.  In the
meantime, I wanted to ask if there was a philosophy
that kept Struts from allowing redirect with
parameters or a limitation that kept it from being
acceptable.  I tried searching the mailing
list archives and have found little or no discussion
about it.



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


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