Created
June 26, 2015 06:01
-
-
Save xtea/a29626a4f59ef14e58b8 to your computer and use it in GitHub Desktop.
SpringMVC会自动为一个Conctroler的URL加上 .* 和 /
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
/** | |
* Add URLs and/or URL patterns for the given path. | |
* @param urls the Set of URLs for the current bean | |
* @param path the currently introspected path | |
*/ | |
protected void addUrlsForPath(Set<String> urls, String path) { | |
urls.add(path); | |
if (this.useDefaultSuffixPattern && path.indexOf('.') == -1 && !path.endsWith("/")) { | |
urls.add(path + ".*"); | |
urls.add(path + "/"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如果不需要这个额外的操作可以将 DefaultAnnotationHandlerMapping.java 的属性: