struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <>
Subject RE: Passing Parameters Between Actions
Date Wed, 16 Jul 2003 03:51:34 GMT
Is there any reason you are forwarding from JSP?

JSP where got?
He stated quite clearly he is forwarding from one action to another using
(returning I presume) an ActionForward.

<forward name="action2" path="/"/>

I was going to suggest that you specify redirect="false" in the forward, but
looking at the javadoc it seems that that is the default already! Hmm.. Try
it anyway and see if it works as it sounds very much like your doing a
client side redirect :-)

If it really is doing a server side redirect you should still be able to get
at that parameter - the only situation I can think of where you would get
these symtoms is if its a multipart request and the first action has an
actionform associated with it and the second does not. (If if that parameter
is due to some other request wrapper implementation). That doesnt explain
the attributes not working though. It really does sound like your doing a
client side redirect.

Hmmm... just checked the source and its definately default to
redirect=false. Ok, I give in...

btw: its considered bad practice to chain actions in this manner. Search the
archive to find out why...

-----Original Message-----
From: Jung Yang []
Sent: Tuesday, 15 July 2003 22:31
Subject: Re: Passing Parameters Between Actions

Is there any reason you are forwarding from JSP?  Try using Dispatcher
in Action1 class like

request.getRequestDispatcher("/").forward(request, response);

- jung

Hunter Hillegas wrote:
> I am trying to pass a parameter between two actions and running into
> trouble.
> I call action 1 like this: /
> Action1 does some processing and when complete it forwards via an
> ActionForward to Action2 as such:
> <forward name="action2" path="/"/>
> Action2 has no way to retrieve the parameter originally passed in to the
> first action, "rec_num". When I try to grab it using
> I get a NPE.
> I also tried setting it as a request attribute and that didn't work.
> might work but I am trying not use sessions.
> Any ideas on what I can do?
> Thanks,
> Hunter

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

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

View raw message