Hi Wojtek,
You'll need to return an ActionRedirect (subclass of ActionForward).
This class includes an addParameter() method. You can use the
constructor to copy the ActionConfig you get from mapping.findForward(),
i.e.:
ActionRedirect ar = new
ActionRedirect(mapping.findForward("showSavedItem.do"));
ar.addParameter("itemId", itemId);
return ar;
Or, if you prefer one-liners:
return (new
ActionRedirect(mapping.findForward("myForward"))).addParameter("itemId",
itemId);
Frank
Wojciech Ciesielski wrote:
Hi there,
How can I add some parameters to redirected forwards? I have situation like
this: saveItem.do saves some object to the database and redirects to
showSavedItem.do, which is based on itemId in request parameter (passed
usually by URL). I want to make this as a redirect to prevent strange things
from happening when user refreshes page. But is there a way to add some
parameters to redirected forwards? Right not I am doing this by setting
session-scope attributes, but it's "messy" - I have to clean up session
afterwards.
TIA
Wojtek
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]