diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java index 8022b3c26a5..60b07a42680 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java @@ -122,7 +122,7 @@ public class ModelAttributeMethodArgumentResolver extends HandlerMethodArgumentR return valueMono.flatMap(value -> { WebExchangeDataBinder binder = context.createDataBinder(exchange, value, name); - return binder.bind(exchange) + return bindRequestParameters(binder, exchange) .doOnError(bindingResultMono::onError) .doOnSuccess(aVoid -> { validateIfApplicable(binder, parameter); @@ -147,6 +147,15 @@ public class ModelAttributeMethodArgumentResolver extends HandlerMethodArgumentR }); } + /** + * Extension point to bind the request to the target object. + * @param binder the data binder instance to use for the binding + * @param exchange the current request + */ + protected Mono bindRequestParameters(WebExchangeDataBinder binder, ServerWebExchange exchange) { + return binder.bind(exchange); + } + private Mono prepareAttributeMono(String attributeName, ResolvableType attributeType, BindingContext context, ServerWebExchange exchange) {