diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java index 9dd6be0c141b21d066d75c66a2dc229da0bd7160..53eda754d032acb9eb54c10ca0ab2b4d5cd50bed 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java @@ -917,9 +917,9 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter } List attrMethods = new ArrayList<>(); // Global methods first - this.modelAttributeAdviceCache.forEach((clazz, methodSet) -> { - if (clazz.isApplicableToBeanType(handlerType)) { - Object bean = clazz.resolveBean(); + this.modelAttributeAdviceCache.forEach((controllerAdviceBean, methodSet) -> { + if (controllerAdviceBean.isApplicableToBeanType(handlerType)) { + Object bean = controllerAdviceBean.resolveBean(); for (Method method : methodSet) { attrMethods.add(createModelAttributeMethod(binderFactory, bean, method)); } @@ -951,9 +951,9 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter } List initBinderMethods = new ArrayList<>(); // Global methods first - this.initBinderAdviceCache.forEach((clazz, methodSet) -> { - if (clazz.isApplicableToBeanType(handlerType)) { - Object bean = clazz.resolveBean(); + this.initBinderAdviceCache.forEach((controllerAdviceBean, methodSet) -> { + if (controllerAdviceBean.isApplicableToBeanType(handlerType)) { + Object bean = controllerAdviceBean.resolveBean(); for (Method method : methodSet) { initBinderMethods.add(createInitBinderMethod(bean, method)); }