private static String getPathPrefix(Class<?> controllerType) { WebApplicationContext wac = getWebApplicationContext(); if (wac != null) { Map<String, RequestMappingHandlerMapping> map = wac.getBeansOfType(RequestMappingHandlerMapping.class); for (RequestMappingHandlerMapping mapping : map.values()) { if (mapping.isHandler(controllerType)) { String prefix = mapping.getPathPrefix(controllerType); if (prefix != null) { return prefix; } } } } return ""; }
private static String getPathPrefix(Class<?> controllerType) { WebApplicationContext wac = getWebApplicationContext(); if (wac != null) { Map<String, RequestMappingHandlerMapping> map = wac.getBeansOfType(RequestMappingHandlerMapping.class); for (RequestMappingHandlerMapping mapping : map.values()) { if (mapping.isHandler(controllerType)) { String prefix = mapping.getPathPrefix(controllerType); if (prefix != null) { return prefix; } } } } return ""; }
@Override protected boolean isHandler(Class<?> beanType) { return (beanType.isAssignableFrom(HttpMessageController.class)) && super.isHandler(beanType); } };
@Override protected boolean isHandler(Class<?> beanType) { if (AnnotationUtils.findAnnotation(beanType, ClassNameMapping.class) != null || AnnotationUtils.findAnnotation(beanType, MethodMapping.class) != null) { return true; } return super.isHandler(beanType); }