> -----Original Message-----
> From: Erik Weber [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 02, 2004 10:33 AM
> To: Struts Users Mailing List
> Subject: Re: struts servlet chaining and immutable request?
> 
> 
> What happens when you append a query String that changes the original 
> parameter value between Actions?
> 
> 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?

Yes, you are misunderstanding.  Forward is an internal struts only forward, it has 
nothing to do with an http forward, ( or a forward pass, or being forward, or forward 
address :) ).  The user will never see anyting until you get to the final action, and 
even then only if it forwards to a jsp.  So, what you are doing is simply calling 
methods, using the struts action forward as your calling mechanism.  
iow the equivalent of:
blah Action1 {
        execute( blah){
                Action action = new Action2();
                action.execute(blah);
                action = new Action3();
                action.execute(blah);
                action = new Action4();
                action.execute(blah);
                returng blah;
        }
}

Which is not what I think you want.

> 
> Erik
> 
> 
> 
> Woodchuck wrote:
> 
> >--- Jim Barrows <[EMAIL PROTECTED]> wrote:
> >
> >  
> >
> >>    
> >>
> >>>-----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.
> >>    
> >>
> >
> >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'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]
> >>
> >>
> >>    
> >>
> >
> >
> >
> >             
> >_______________________________
> >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]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to