Originally posted by Arun Sri:
Hi All,
I am facing one problem with Validation framework in struts.
I have 2 buttons (Back & Save) in my JSP page and i want to validate the page only when user modify the page and press the Save button.
If user didn't modify the page and press back button i don't want to validate the page. Is it any attribute thru which i can bypass the validation.
Thx in advance..
What you want is for the Back button to be treated like a Cancel button. You do this in Velocity using the $form.cancelName (or $form.getCancelName()). In JSP its a constant in the Struts html taglib.. Here's the Velocity
doc.
getCancelName
public java.lang.String getCancelName()Returns the query parameter name under which a cancel button press must be reported if form validation is to be skipped.
This is the value of org.apache.struts.taglib.html.Constants.CANCEL_PROPERTY
Here's an example of its use