struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <>
Subject RE: passing parameters or object from one action to other
Date Thu, 05 Jun 2003 11:35:15 GMT
(Oops. Hit send too soon. Try again!)

You can put them in the request as attributes and use a non-redirecting
forward *but* then you are 'action chaining'.

(Action chains are bad. n'kay)

The other alternative - suitable for string parameters - is to make them
request parameters by appending to the url.
To do this you create a new forward based on the existing forward. ie in
your action:

ActionForward forward = mapping.findForward("myforward");
forward = new
ctionForward( addParameterToUrl(forward.getPath(),"foo","bar"),
forward.getRedirect() );
return forward;

where addParameterToUrl does something like:

  private String addParameterToURL(String url, String parameter, String
    return url + ( (url.indexOf("?")==-1) ? "?" : "&" ) + parameter + "=" +

-----Original Message-----
Sent: Thursday, 5 June 2003 19:25
Subject: passing parameters or object from one action to other

hi all,

I have an action1 whose forward is another action2.

I need to pass some parameters or object from action1
to action2

I don't want to put them(parameters or object) in the session.

Is there a solution for doing that.

thanks in advance


L'integrite de ce message n'etant pas assuree sur internet, Natexis
Banques Populaires ne peut etre tenu responsable de
son contenu. Toute utilisation ou diffusion non autorisee est
interdite. Si vous n'etes pas destinataire de ce message, merci de le
detruire et d'avertir l'expediteur.

The integrity of this message cannot be guaranteed
on the Internet. Natexis Banques Populaires can not therefore be
considered responsible for the contents.Any unauthorized use or
dissemination is prohibited.
If you are not the intended recipient of this message, then please delete it
notify the sender.

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

View raw message