Working on SPR-5631 - Implicit /** mapping on type-level @RequestMapping

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1011 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma
2009-04-16 13:23:24 +00:00
parent 674d7870ba
commit 77d364af60
2 changed files with 29 additions and 7 deletions
@@ -110,11 +110,19 @@ public class DefaultAnnotationHandlerMapping extends AbstractDetectingUrlHandler
// @RequestMapping found at type level
this.cachedMappings.put(handlerType, mapping);
Set<String> urls = new LinkedHashSet<String>();
String[] paths = mapping.value();
if (paths.length > 0) {
String[] typeLevelPaths = mapping.value();
if (typeLevelPaths.length > 0) {
// @RequestMapping specifies paths at type level
for (String path : paths) {
addUrlsForPath(urls, path);
String[] methodLevelPaths = determineUrlsForHandlerMethods(handlerType);
for (String typeLevelPath : typeLevelPaths) {
if (!typeLevelPath.startsWith("/")) {
typeLevelPath = "/" + typeLevelPath;
}
for (String methodLevelPath : methodLevelPaths) {
String combinedPath = getPathMatcher().combine(typeLevelPath, methodLevelPath);
addUrlsForPath(urls, combinedPath);
}
addUrlsForPath(urls, typeLevelPath);
}
return StringUtils.toStringArray(urls);
}