BindingResult is the Spring interface that holds the outcome of data binding and validation for one model object. When a controller method has a @Valid (or @Validated) argument followed directly by a BindingResult parameter, Spring puts type-conversion errors and constraint violations into it instead of failing the request, so your code can inspect the errors and re-display the form.
It extends Errors, and it is what Thymeleaf, JSP form tags, and your own code read to show field-level messages.
BindingResult storesBindingResult in a controllerBindingResult storesWhen Spring MVC binds request parameters to an object such as a form bean, two kinds of problems can occur: binding errors (for example text typed into an int field) and validation errors (a failed Bean Validation constraint such as @NotBlank). Both become entries in the BindingResult:
| Type | Represents | Example |
|---|---|---|
FieldError | An error tied to one field | name must be 5 to 50 characters |
ObjectError | An error about the object as a whole | Password and confirmation do not match |
BindingResult in a controllerAnnotate the form object with constraints. Spring Boot 3 and Spring Framework 6 use the jakarta.validation package; older versions use javax.validation.
Then declare BindingResult immediately after the argument it describes:
The position matters. BindingResult must come right after the model attribute it validates. If another parameter sits in between, or if you omit BindingResult entirely, Spring raises an exception and responds with HTTP 400 instead of letting your method handle the errors.
The common methods come from Errors:
You can add your own errors for rules that annotations cannot express, such as a uniqueness check:
rejectValue attaches the error to a field. reject records a global error.
Thymeleaf reads the BindingResult that Spring registered under org.springframework.validation.BindingResult.user. Keep the model attribute name consistent between the controller and the template.
For @RequestBody JSON input, you can still add a BindingResult after the @Valid argument, but most APIs omit it. Without it, Spring throws MethodArgumentNotValidException, which you handle once in a @RestControllerAdvice and turn into a structured 400 response (often as RFC 9457 problem details, which Spring supports through ProblemDetail). Use BindingResult in a REST method only when you need custom handling inside that single method.
BindingResult appear in the method signature?Immediately after the @Valid model attribute or request body it refers to. Putting Model or another argument between them breaks the pairing.
BindingResult?Spring throws an exception when validation fails and returns HTTP 400. Your controller method is not called.
BindingResult the same as Errors?BindingResult extends Errors and adds binding-specific features. In practice you can declare either type for the parameter.
@Valid to get a BindingResult?No. Binding errors such as type mismatches are captured anyway. @Valid or @Validated additionally triggers constraint validation.
BindingResult collects binding and validation errors for a single model object so a Spring MVC controller can react to them. Put it directly after the @Valid argument, check hasErrors(), add custom errors with reject and rejectValue, and render the messages in the view. For JSON APIs, prefer a central @RestControllerAdvice over per-method handling.