@@ -13,15 +13,15 @@ xref:web/webflux/controller/ann-methods/multipart-forms.adoc[@RequestPart] argum
1313resolvers validate a method argument individually if the method parameter is annotated
1414with Jakarta `@Valid` or Spring's `@Validated`, _AND_ there is no `Errors` or
1515`BindingResult` parameter immediately after, _AND_ method validation is not needed (to be
16- discussed next). The exception raised in this case is `MethodArgumentNotValidException `.
16+ discussed next). The exception raised in this case is `WebExchangeBindException `.
1717
18182. When `@Constraint` annotations such as `@Min`, `@NotBlank` and others are declared
1919directly on method parameters, or on the method (for the return value), then method
2020validation must be applied, and that supersedes validation at the method argument level
2121because method validation covers both method parameter constraints and nested constraints
2222via `@Valid`. The exception raised in this case is `HandlerMethodValidationException`.
2323
24- Applications must handle both `MethodArgumentNotValidException ` and
24+ Applications must handle both `WebExchangeBindException ` and
2525`HandlerMethodValidationException` as either may be raised depending on the controller
2626method signature. The two exceptions, however are designed to be very similar, and can be
2727handled with almost identical code. The main difference is that the former is for a single
@@ -39,7 +39,7 @@ method parameters with an `Errors` immediately after. If there are validation er
3939any other method parameter then `HandlerMethodValidationException` is raised.
4040
4141You can configure a `Validator` globally through the
42- xref:web/webflux/config.adoc#webflux-config-validation[WebMvc config], or locally
42+ xref:web/webflux/config.adoc#webflux-config-validation[WebFlux config], or locally
4343through an xref:web/webflux/controller/ann-initbinder.adoc[@InitBinder] method in an
4444`@Controller` or `@ControllerAdvice`. You can also use multiple validators.
4545
@@ -49,8 +49,8 @@ through an AOP proxy. In order to take advantage of the Spring MVC built-in supp
4949method validation added in Spring Framework 6.1, you need to remove the class level
5050`@Validated` annotation from the controller.
5151
52- The xref:web/webmvc/mvc- ann-rest-exceptions.adoc[Error Responses] section provides further
53- details on how `MethodArgumentNotValidException ` and `HandlerMethodValidationException`
52+ The xref:web/webflux/ ann-rest-exceptions.adoc[Error Responses] section provides further
53+ details on how `WebExchangeBindException ` and `HandlerMethodValidationException`
5454are handled, and also how their rendering can be customized through a `MessageSource` and
5555locale and language specific resource bundles.
5656
0 commit comments