struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Help My PC! <>
Subject Re: (Rename) How Do I Forward Request Parameters in Struts?
Date Sat, 09 Sep 2006 15:24:48 GMT
Thanks for the help. You've solved my problem.

Michael Jouravlev <> wrote: On 9/5/06, Help My PC!  wrote:
> Hi,
> In struts, I have an action Act1 that forwards to a display page Page1.
> On that page there is a submit button whose action act2 forwards to
> display page Page2.
> I need to modify Page1 in such a way that I add an additional submit
> button whose action Act1A forwards to display page Page1A. On page Page1A
> there is a button whose action is the same as in the previous flow,
> Act2, but the request parameters from Page1 and Page1a I'd like to forward
> to Act 2.
> What is the best way to handle this?
> My action, Act1a returns null, but when I'm losing the request
> parameters from page 1. How do I forward the request parameters from page 1
> while maintaining the request parameters from page1a to action2?
> I hope that this makes sense. Thanks for your assistance.

The following are standard choices:

(1) Use hidden form fields

In Act1A gather parameters from Page1 and stick them into a form on
Page1A as hidden fields. In Act2 read values of these hidden fields
from request. If you want to autopopulate the ActionForm that
corresponds to Act2 with values from Page1, then you need to have the
appropriate setters.

(1) Use session-scoped object (either an ActionForm or your own)

Session-scoped ActionForms are not recreated on each request, so you
can lookup for an ActionForm that corresponds to Act1 in the
HttpSession object to retrieve the values. You will need to dispose of
that ActionForm manually if you want to conserve server's memory.


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

Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1&cent;/min.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message