Skip to content

Instantly share code, notes, and snippets.

@nyilmaz
Created June 5, 2014 10:35
Show Gist options
  • Save nyilmaz/6d2880edbb7d4699606b to your computer and use it in GitHub Desktop.
Save nyilmaz/6d2880edbb7d4699606b to your computer and use it in GitHub Desktop.
@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