SPR-8712 Expose BEST_MATCHING_PATTERN_ATTRIBUTE in RequestMappingHandlerMapping.

This commit is contained in:
Rossen Stoyanchev
2011-09-20 10:09:52 +00:00
parent 7a3f02bce9
commit f200ccd899
2 changed files with 61 additions and 44 deletions

View File

@@ -86,6 +86,8 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
super.handleMatch(info, lookupPath, request);
String pattern = info.getPatternsCondition().getPatterns().iterator().next();
request.setAttribute(BEST_MATCHING_PATTERN_ATTRIBUTE, pattern);
Map<String, String> uriTemplateVariables = getPathMatcher().extractUriTemplateVariables(pattern, lookupPath);
request.setAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, uriTemplateVariables);