From 611d3e5551f018a6ec2ab1094250011d2c15d1cf Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Wed, 10 Jul 2024 17:55:19 +0100 Subject: [PATCH] Correct type names in docs on Validation in WebFlux Closes gh-33061 --- .../pages/web/webflux/controller/ann-validation.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-validation.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-validation.adoc index 41c753c53967..59090a205692 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-validation.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-validation.adoc @@ -13,7 +13,7 @@ xref:web/webflux/controller/ann-methods/multipart-forms.adoc[@RequestPart] argum resolvers validate a method argument individually if the method parameter is annotated with Jakarta `@Valid` or Spring's `@Validated`, _AND_ there is no `Errors` or `BindingResult` parameter immediately after, _AND_ method validation is not needed (to be -discussed next). The exception raised in this case is `MethodArgumentNotValidException`. +discussed next). The exception raised in this case is `WebExchangeBindException`. 2. When `@Constraint` annotations such as `@Min`, `@NotBlank` and others are declared directly on method parameters, or on the method (for the return value), then method @@ -21,7 +21,7 @@ validation must be applied, and that supersedes validation at the method argumen because method validation covers both method parameter constraints and nested constraints via `@Valid`. The exception raised in this case is `HandlerMethodValidationException`. -Applications must handle both `MethodArgumentNotValidException` and +Applications must handle both `WebExchangeBindException` and `HandlerMethodValidationException` as either may be raised depending on the controller method signature. The two exceptions, however are designed to be very similar, and can be 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 any other method parameter then `HandlerMethodValidationException` is raised. You can configure a `Validator` globally through the -xref:web/webflux/config.adoc#webflux-config-validation[WebMvc config], or locally +xref:web/webflux/config.adoc#webflux-config-validation[WebFlux config], or locally through an xref:web/webflux/controller/ann-initbinder.adoc[@InitBinder] method in an `@Controller` or `@ControllerAdvice`. You can also use multiple validators. @@ -49,8 +49,8 @@ through an AOP proxy. In order to take advantage of the Spring MVC built-in supp method validation added in Spring Framework 6.1, you need to remove the class level `@Validated` annotation from the controller. -The xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses] section provides further -details on how `MethodArgumentNotValidException` and `HandlerMethodValidationException` +The xref:web/webflux/ann-rest-exceptions.adoc[Error Responses] section provides further +details on how `WebExchangeBindException` and `HandlerMethodValidationException` are handled, and also how their rendering can be customized through a `MessageSource` and locale and language specific resource bundles.