Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing request attributes when doing forward - redirect

 
Maciej Kolodziej
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can I pass request attributes between actions if the forward the first action use is redirect="true"?
I mean I have an action which has at its end:

Where open logical is defined as:

How can I pass the attribute from the first action to open_logical.do action?
Is putting it into session the only way?
Thanks,
[ January 23, 2003: Message edited by: Maciej Kolodziej ]
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't pass request attributes like you want when redirect="true". The reason is that there is another request generated. With a redirect, the response returned to the client tells the client to request another URL, which of course initiates another request-response cycle, so you will lose whatever you placed into request.
 
Maciej Kolodziej
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I know that. But is there any way to set this another url to have some parameters? Particularly the ones I take from the first request?
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's kind of kludge-ish, but you can create a new ActionForward and initialize it with its setters and the getters from the original, then return the copy.
i.e.

Or you can avoid having to do the redirect.
:roll:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic