I have scenario to Ignore the Struts Validation on application back for some of the pages. I have a flow of pages. User completes one page and click "Next" button to enter into another page. While clicking the Next there is Validation check for mandatory elements, and they are working fine.
In the same page there is "Back" button, clicking on that button user is navigated to previous page. User should allow to go to previous page even if mandatory elements not entered. But in my case Mandatory checks are stopping.
I am using Struts Validation Frame work.
I have AdminWorkFlow-Validation.xml file which has all the required validation for the pages.
How to make Validation check Ignore when clicked on the Back button.
Using Struts 2.0.11 and
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
I have found the solution to my problem. I created my own Validators. Which Handles two things.
Managing multiple series of forms with same action by providing the Wizard Index(Static) and Page Index(Set by Page). Sample Code :
/**
*/
public class MandatoryStringFieldValidator extends FieldValidatorSupport {
}
Validation.xml
Finally in -validation.xml
Please Note : I have stripped of bit of code as it has production code and Changed the names in the file as well.