struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Chelimsky <>
Subject Re: passing parameters or object from one action to other
Date Thu, 05 Jun 2003 12:59:28 GMT
Isn't this just action chaining using HTTP instead of within the jvm? 
I'm not sure I get the reasons why action chaining is inherently a bad 
idea, though I do get that there are potential pitfalls if misused, but 
that's true of many patterns. Can you explain? Or point me to an article 
that explains? Thanks.

Andrew Hill wrote:

>(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:

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

View raw message