I have annotated mappings working great through my spring mvc web app, however, they are case sensitive. I cannot find a way to make them case insensitive. (I\'d love to mak
According to this webpost you need to add both a HandlerMapping and a HandlerAdapter in Spring MVC. The Mapping maps the request to a corresponding controller, and the adapter is responsible to execute the request using the controller.
You therefore need to override the PathMatcher for both the mapper and adapter.
Ex (will make all @Controllers case-insensitive):
New Matcher:
public class CaseInsenseticePathMatcher extends AntPathMatcher {
@Override
protected boolean doMatch(String pattern, String path, boolean fullMatch, Map uriTemplateVariables) {
System.err.println(pattern + " -- " + path);
return super.doMatch(pattern.toLowerCase(), path.toLowerCase(), fullMatch, uriTemplateVariables);
}
}
applicationContext.xml:
Added about the same that