@@ -13,15 +13,15 @@ xref:web/webflux/controller/ann-methods/multipart-forms.adoc[@RequestPart] argum
13
13
resolvers validate a method argument individually if the method parameter is annotated
14
14
with Jakarta `@Valid` or Spring's `@Validated`, _AND_ there is no `Errors` or
15
15
`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 `.
17
17
18
18
2. When `@Constraint` annotations such as `@Min`, `@NotBlank` and others are declared
19
19
directly on method parameters, or on the method (for the return value), then method
20
20
validation must be applied, and that supersedes validation at the method argument level
21
21
because method validation covers both method parameter constraints and nested constraints
22
22
via `@Valid`. The exception raised in this case is `HandlerMethodValidationException`.
23
23
24
- Applications must handle both `MethodArgumentNotValidException ` and
24
+ Applications must handle both `WebExchangeBindException ` and
25
25
`HandlerMethodValidationException` as either may be raised depending on the controller
26
26
method signature. The two exceptions, however are designed to be very similar, and can be
27
27
handled 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
39
39
any other method parameter then `HandlerMethodValidationException` is raised.
40
40
41
41
You 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
43
43
through an xref:web/webflux/controller/ann-initbinder.adoc[@InitBinder] method in an
44
44
`@Controller` or `@ControllerAdvice`. You can also use multiple validators.
45
45
@@ -49,8 +49,8 @@ through an AOP proxy. In order to take advantage of the Spring MVC built-in supp
49
49
method validation added in Spring Framework 6.1, you need to remove the class level
50
50
`@Validated` annotation from the controller.
51
51
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`
54
54
are handled, and also how their rendering can be customized through a `MessageSource` and
55
55
locale and language specific resource bundles.
56
56
0 commit comments