| 
28 | 28 | 
 
  | 
29 | 29 | import org.springframework.context.EmbeddedValueResolverAware;  | 
30 | 30 | import org.springframework.core.annotation.AnnotatedElementUtils;  | 
 | 31 | +import org.springframework.core.annotation.AnnotationUtils;  | 
31 | 32 | import org.springframework.lang.Nullable;  | 
32 | 33 | import org.springframework.stereotype.Controller;  | 
33 | 34 | import org.springframework.util.Assert;  | 
@@ -218,6 +219,9 @@ protected boolean isHandler(Class<?> beanType) {  | 
218 | 219 | 	@Nullable  | 
219 | 220 | 	protected RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType) {  | 
220 | 221 | 		RequestMappingInfo info = createRequestMappingInfo(method);  | 
 | 222 | +		if (info == null) {  | 
 | 223 | +			info = createRequestMappingInfo(method, handlerType.getInterfaces());  | 
 | 224 | +		}  | 
221 | 225 | 		if (info != null) {  | 
222 | 226 | 			RequestMappingInfo typeInfo = createRequestMappingInfo(handlerType);  | 
223 | 227 | 			if (typeInfo != null) {  | 
@@ -259,6 +263,17 @@ private RequestMappingInfo createRequestMappingInfo(AnnotatedElement element) {  | 
259 | 263 | 				getCustomTypeCondition((Class<?>) element) : getCustomMethodCondition((Method) element));  | 
260 | 264 | 		return (requestMapping != null ? createRequestMappingInfo(requestMapping, condition) : null);  | 
261 | 265 | 	}  | 
 | 266 | +	  | 
 | 267 | +	/**  | 
 | 268 | +	 * support for methods that declared in interfaces and implemented in super class  | 
 | 269 | +	 * @since 5.1  | 
 | 270 | +	 */  | 
 | 271 | +	@Nullable  | 
 | 272 | +	private RequestMappingInfo createRequestMappingInfo(Method method, Class<?>[] ifcs) {  | 
 | 273 | +		RequestMapping requestMapping = AnnotationUtils.searchOnInterfaces(method, RequestMapping.class, ifcs);  | 
 | 274 | +		RequestCondition<?> condition = getCustomMethodCondition(method);  | 
 | 275 | +		return (requestMapping != null ? createRequestMappingInfo(requestMapping, condition) : null);  | 
 | 276 | +	}  | 
262 | 277 | 
 
  | 
263 | 278 | 	/**  | 
264 | 279 | 	 * Provide a custom type-level request condition.  | 
 | 
0 commit comments