HTML5 Validation Dialect - Usage

Spring users

  1. Configure JSR-303 annotations in your form bean

  2. Add a instance of the form bean to your model in your controller

  3. Use val:validate in your HTML form

  4. Use @Valid annotation in your controller

In order to make the example simpler, th:field is not used, but you usually would combine val:validate with th:object and th:errors.

You could also download the example webapp or browse its source code.



Back to home page