struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Moore <>
Subject Re: Newbie question: How to implement conditional validation in an ActionForm?
Date Thu, 13 May 2004 16:33:28 GMT
Adam Lipscombe wrote:

>I have implemented  a wizard framework. Each JSP page uses the same
>ActionForm, passing a hidden property "pageNumber" to control which
>validation  is applied. As the wizard progresses the ActionForm data is
>built up.
>This works well as long as the user presses "next" or finish".
>However if the user presses "cancel"  the ActionForm.validate() method is
>called and the wizard page is re-displayed with any errors.
>If the cancel is pressed I just want to exit the wizard without calling the
>ActionForm.validate() method.Or at least be able to detect that the cancel
>button was pressed within the ActionForm.validate() method.
>Apologies if this is obvious. Any ideas?
Where are you doing your validation? I've done something similar (a 
wizard) and I'm doing the validation within the Action class. I test for 
which submit button has been pressed (i.e., what the text of the 
'submit' parameter is) and act accordingly. You could certainly test for 
Cancel there and bypass the validation.


John Moore  -  Norwich, UK  -

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message