Hello Adam

I have one doubt. 

You have base action class for all your subaction classes.
What is the responsibility of this base action class.
Do your base action class checks which button is clicked?
If there are say 10 buttons in one form (say, GO, ADD, SAVE, NEXT, etc)
are there 10 if statements in your class. Or it
is sub action class resposibility to check this.? are there 10 or (any no)
of if statements in subaction classes.?
How to eliminate those if statements? any idea?

Pls reply
Shashank


----- Original Message ----- 
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 09, 2003 2:52 PM
Subject: Re: Design question: Confirm action after validation ?


> I have an Action base class which all my other Action classes inherit. 
> In the execute() of this base class I check whether the user clicked 
> cancel, before I call the child class execute().
> 
> I presume it would be easy enough to store the originating URL in the 
> session, and if cancel is clicked, roll your own Action Forward back to 
> this URL.
> 
> Since it is all in the base class, it could work for every action as 
> long as you are careful to watch the parameters or ids.
> 
> Ajay Patil wrote:
> > Hello,
> > 
> > In my Struts application, the validation is done on server-side 
> > for every page. If the validation is successful, the user would
> > like to see a page to confirm his action. The Confirm page should
> > also have a Cancel button allowing him to go back to the previous
> > page showing the data entered so far.
> > 
> > This functionality is needed for every action.
> > 
> > I am thinking if there is a generic way by which I can achieve this
> > functionality. 
> > 
> > I also realize that I might end up making scope=session for
> > every form, in trying to implement this requirement. (and I am
> > worried about this too).
> > 
> > Any ideas, pointers and/or thoughts will be very useful.
> > 
> > Ajay
> > 
> > ----------------------------------------------------
> > Ajay Patil
> > Vertex Software Pvt. Ltd.
> > [EMAIL PROTECTED]
> > http://www.vertex.co.in
> > ----------------------------------------------------
> > 
> > 
> > ---------------------------------------------------------------------
> > 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