consistent handling of handler methods, init binder methods and model attribute methods (SPR-7355)
This commit is contained in:
parent
722778c74a
commit
6b3c299a50
|
|
@ -89,10 +89,12 @@ public class HandlerMethodResolver {
|
||||||
(bridgedMethod == specificMethod || !isHandlerMethod(bridgedMethod))) {
|
(bridgedMethod == specificMethod || !isHandlerMethod(bridgedMethod))) {
|
||||||
handlerMethods.add(specificMethod);
|
handlerMethods.add(specificMethod);
|
||||||
}
|
}
|
||||||
else if (method.isAnnotationPresent(InitBinder.class)) {
|
else if (isInitBinderMethod(specificMethod) &&
|
||||||
|
(bridgedMethod == specificMethod || !isInitBinderMethod(bridgedMethod))) {
|
||||||
initBinderMethods.add(specificMethod);
|
initBinderMethods.add(specificMethod);
|
||||||
}
|
}
|
||||||
else if (method.isAnnotationPresent(ModelAttribute.class)) {
|
else if (isModelAttributeMethod(specificMethod) &&
|
||||||
|
(bridgedMethod == specificMethod || !isModelAttributeMethod(bridgedMethod))) {
|
||||||
modelAttributeMethods.add(specificMethod);
|
modelAttributeMethods.add(specificMethod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -111,6 +113,14 @@ public class HandlerMethodResolver {
|
||||||
return AnnotationUtils.findAnnotation(method, RequestMapping.class) != null;
|
return AnnotationUtils.findAnnotation(method, RequestMapping.class) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isInitBinderMethod(Method method) {
|
||||||
|
return AnnotationUtils.findAnnotation(method, InitBinder.class) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isModelAttributeMethod(Method method) {
|
||||||
|
return AnnotationUtils.findAnnotation(method, ModelAttribute.class) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public final boolean hasHandlerMethods() {
|
public final boolean hasHandlerMethods() {
|
||||||
return !this.handlerMethods.isEmpty();
|
return !this.handlerMethods.isEmpty();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue