Skip to main content

BindingResult

Learn BindingResult (Validation, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes BindingResult holds the outcome of data binding and validation for one model object: field errors, global errors and the rejected values. Position : it must be declared right after the @Valid or @ModelAttribute parameter, or Spring throws an exception instead of filling it. Use : check result.hasErrors() and redisplay the form; the view reads the errors, for example with th:errors or form:errors .

More lessons in Validation