On 7/22/05, Rick Reumann <[EMAIL PROTECTED]> wrote: > Kent Boogaart wrote the following on 7/22/2005 5:49 AM: > > > > My actions for pages 2 and 3 have code like this in them: > > > > if (isCancelled(request)) { > > return mapping.findForward(FORWARD_CANCELLED); > > } > > > > My question is: is this the normal way to do it? If so, is there an easy / > > nice way to reset the cancel flag. I understand I could just remove a > > request parameter but I want to make sure I'm doing this the best way. > > I'm really not sure of the 'best' way and I'm probably not doing it the > 'standard' way, but since I like to manually call validate from my > Actions, I just treat 'cancel' like I would any other form submit. (The > only benefit to the html:cancel tag (I think:) is that it allows you to > submit the page without having validate() called.) > > Since I like dispatch actions, I just pass the dispatch parameter > "cancel" and then I process it how I want in the action in my "cancel" > dispatch method. Sometimes, when I know the user can only get to the > page from a certain flow it allows me to call my prep() method and prep > the reulting page with whatever it needs for display.
I second that approach. Instead that I use redirect instead of forward, so all request parameters including Cancel are cleared automatically. It may make sense to build each page as a dialog. Or even to create a wizard out of three pages. -- Struts Dialogs http://struts.sourceforge.net/strutsdialogs --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]