Skip to main content

Form Error Handling

Learn Form Error Handling (Form Handling, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Form error handling means showing the user what went wrong in a submitted form, next to the field, while keeping the values they typed. Flow : binding or validation fails, errors go into BindingResult , the handler returns the form view again and the template prints the errors. Thymeleaf : th:errors="*{email}" prints the messages of a field and #fields.hasErrors(...) checks for them.

More lessons in Form Handling