For example, the original request is to A.do?foo=oldValue. Then when that Action finishes processing, it forwards to B.do?foo=newValue.
Doesn't that work or am I misunderstanding?
Erik
Woodchuck wrote:
--- Jim Barrows <[EMAIL PROTECTED]> wrote:
five-----Original Message----- From: Woodchuck [mailto:[EMAIL PROTECTED] Sent: Thursday, September 02, 2004 10:02 AM To: struts Subject: struts servlet chaining and immutable request?
hihi,
in my Action object, i am doing servlet chaining by forwarding to
another ".do" instead of forwarding to a ".jsp". so if i chain
samedifferent Actions, they will execute like: Action1 -> Action2 -> Action3... Action5
however, when doing this, the original request object is maintained throughout the chaining such that Action5 doesn't know (or care) whether the request was made directly or indirectly.
my problem is that during the chaining, each Action looks at the
parameter in it's execute method to decide to do something. but because the request is immutable the next Action sees the same parameter value and does the same thing.
how can i change the value of the request parameter after it's been
'used' by one Action, so the next Action sees an updated paramter
value?
Ummmm..... this sounds bizaare enough to make me question the engineering behind this. Seems like it would be better to put the code your trying to execute into a business logic layer, or otherwise outside the action class to begin with. However, I'll assume you have no choice...
However, in answer to your qustion... have the action class check a
session attribute first, then check the request parameter.
i'm implementing a "wizard". it contains multiple different screens (jsps), so i decided to make an abstract Action class to handle the "Next", "Back" buttons on each jsp.
are there better strategies to handle "wizard" scenarios in struts?
so in my abstract Action class i'm looking at the button paramter, if it's "Next" i will call an abstract Save method that the super class implements. then i will forward to the next Action screen (same abstract class).. but the request parameter button still says "Next" so it keeps going next forever... :/
(if you're wondering why my Actions are setup like this, it'sbecause
they all extend the same abstract Action class that has logic to do---------------------------------------------------------------------
processing based on the request parameter... so what's really happening
is that each Action is executing the same thing but i'd like to be able
to have them do different things)
any suggestions is much appreciated and thanks in advance,
woodchuck
_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_______________________________ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

