diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java index e88ece401d..97fe1b0213 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java @@ -379,7 +379,7 @@ public class MvcUriComponentsBuilder { private static String getTypeRequestMapping(Class controllerType) { Assert.notNull(controllerType, "'controllerType' must not be null"); String annotType = RequestMapping.class.getName(); - AnnotationAttributes attrs = AnnotatedElementUtils.getAnnotationAttributes(controllerType, annotType); + AnnotationAttributes attrs = AnnotatedElementUtils.findAnnotationAttributes(controllerType, annotType); if (attrs == null) { return "/"; } @@ -396,7 +396,7 @@ public class MvcUriComponentsBuilder { private static String getMethodRequestMapping(Method method) { String annotType = RequestMapping.class.getName(); - AnnotationAttributes attrs = AnnotatedElementUtils.getAnnotationAttributes(method, annotType); + AnnotationAttributes attrs = AnnotatedElementUtils.findAnnotationAttributes(method, annotType); if (attrs == null) { throw new IllegalArgumentException("No @RequestMapping on: " + method.toGenericString()); } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java index 3b318acdb7..3e66d60055 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java @@ -246,13 +246,13 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi if (annotatedElement instanceof Class) { Class type = (Class) annotatedElement; annotation = AnnotationUtils.findAnnotation(type, RequestMapping.class); - attributes = AnnotatedElementUtils.getAnnotationAttributes(type, annotationType); + attributes = AnnotatedElementUtils.findAnnotationAttributes(type, annotationType); customCondition = getCustomTypeCondition(type); } else { Method method = (Method) annotatedElement; annotation = AnnotationUtils.findAnnotation(method, RequestMapping.class); - attributes = AnnotatedElementUtils.getAnnotationAttributes(method, annotationType); + attributes = AnnotatedElementUtils.findAnnotationAttributes(method, annotationType); customCondition = getCustomMethodCondition(method); } RequestMappingInfo info = null;