> -----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 five > different 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 same > 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. > > (if you're wondering why my Actions are setup like this, it's because > 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]