Created
June 5, 2014 10:35
-
-
Save nyilmaz/6d2880edbb7d4699606b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public RequestMappingInfoAppendableHandlerMapping requestMappingHandlerMapping() { | |
RequestMappingInfoAppendableHandlerMapping requestMappingHandlerMapping = new RequestMappingInfoAppendableHandlerMapping(); | |
if(matchGeneralConfiguration.getV4Enabled()) { | |
requestMappingHandlerMapping = new V4RequestMappingHandlerMapping(); | |
mLogger.info("V4 configuration enabled. Only V4Controllers will be registered."); | |
} | |
requestMappingHandlerMapping.setOrder(0); | |
requestMappingHandlerMapping.setInterceptors(getInterceptors()); | |
requestMappingHandlerMapping.setContentNegotiationManager(mvcContentNegotiationManager()); | |
requestMappingHandlerMapping.setUseTrailingSlashMatch(true); | |
requestMappingHandlerMapping.setUseSuffixPatternMatch(false); | |
return requestMappingHandlerMapping; | |
} | |
static class V4RequestMappingHandlerMapping extends RequestMappingInfoAppendableHandlerMapping { | |
@Override | |
protected boolean isHandler(Class<?> beanType) { | |
return AnnotationUtils.findAnnotation(beanType, V4Controller.class) != null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment