|
|
|
@ -772,16 +772,17 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter i |
|
|
|
|
this.modelAttributeCache.put(handlerType, methods); |
|
|
|
|
} |
|
|
|
|
List<InvocableHandlerMethod> attrMethods = new ArrayList<InvocableHandlerMethod>(); |
|
|
|
|
for (Method method : methods) { |
|
|
|
|
Object bean = handlerMethod.getBean(); |
|
|
|
|
attrMethods.add(createModelAttributeMethod(binderFactory, bean, method)); |
|
|
|
|
} |
|
|
|
|
// Global methods first
|
|
|
|
|
for (Entry<ControllerAdviceBean, Set<Method>> entry : this.modelAttributeAdviceCache.entrySet()) { |
|
|
|
|
Object bean = entry.getKey().resolveBean(); |
|
|
|
|
for (Method method : entry.getValue()) { |
|
|
|
|
attrMethods.add(createModelAttributeMethod(binderFactory, bean, method)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (Method method : methods) { |
|
|
|
|
Object bean = handlerMethod.getBean(); |
|
|
|
|
attrMethods.add(createModelAttributeMethod(binderFactory, bean, method)); |
|
|
|
|
} |
|
|
|
|
return new ModelFactory(attrMethods, binderFactory, sessionAttrHandler); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -801,16 +802,17 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter i |
|
|
|
|
this.initBinderCache.put(handlerType, methods); |
|
|
|
|
} |
|
|
|
|
List<InvocableHandlerMethod> initBinderMethods = new ArrayList<InvocableHandlerMethod>(); |
|
|
|
|
for (Method method : methods) { |
|
|
|
|
Object bean = handlerMethod.getBean(); |
|
|
|
|
initBinderMethods.add(createInitBinderMethod(bean, method)); |
|
|
|
|
} |
|
|
|
|
// Global methods first
|
|
|
|
|
for (Entry<ControllerAdviceBean, Set<Method>> entry : this.initBinderAdviceCache .entrySet()) { |
|
|
|
|
Object bean = entry.getKey().resolveBean(); |
|
|
|
|
for (Method method : entry.getValue()) { |
|
|
|
|
initBinderMethods.add(createInitBinderMethod(bean, method)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (Method method : methods) { |
|
|
|
|
Object bean = handlerMethod.getBean(); |
|
|
|
|
initBinderMethods.add(createInitBinderMethod(bean, method)); |
|
|
|
|
} |
|
|
|
|
return createDataBinderFactory(initBinderMethods); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|