i have a kind of wizard: a set of pages which are all filled from the same form (a ValidatorForm) and all processed by the same action (which - if necessary - forwards the request to the appropriate special action)
i want to use declarative validation for that.
suppose i have field A on page 1, field B on page 2, let both be required.
when validation fails, the processor would normaly forward the request to the (single) page defined with the input attribute.
what i obviously want is - if field A is missing, forward to page 1 - if field B is missing, forward to page 2
is there any way that i can achieve this declaratively?
As I see it, the best way to achieve this is to create a separate action mapping for each page. Even if you are using the same Action class for every page, you can still have a separate Action mapping. example:
You would then have your form bean extend ValidatorActionForm instead of ValidatorForm. In the validation.xml file, you would specify the action path as the name attribute of the form tag instead of the ActionForm name. Then include only the fields processed by that action path (page).
Since there is a separate input page for each action mapping, the Validation Framework will return to the correct page if there's an error.