2

When should we use ValidatorForm, ValidatorActionForm, and their dynamic variants in struts based applications?

Xavier
  • 3,423
  • 23
  • 36
MiKe
  • 55
  • 5

1 Answers1

1

The difference is that the validation rules of a ValidatorActionForm are not assigned to the action form but to the action (/path-to-action.do). So it is possible to reuse a bean in multiple actions but to define different validations for each action.

<form-validation>
    <formset>
        <!-- validation mapping for action /example1 -->
        <form name="/example1">
            ...
        </form>
    </formset>
    <formset>
        <!-- validation mapping for action /example2 -->
        <form name="/example2">
            ...
        </form>
    </formset>
</form-validation>

See also:

Paul Vargas
  • 41,222
  • 15
  • 102
  • 148