Skip to content

Commit

Permalink
Decode path vars in pre-3.1 @MVC support clases too
Browse files Browse the repository at this point in the history
See the commit comments for:
57307a0

This commit also applies the change to pre-3.1 `@MVC` suppor classes.

Issue: SPR-6951
  • Loading branch information
rstoyanchev committed May 17, 2012
1 parent 57307a0 commit 0105c5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -185,8 +185,9 @@ protected Object lookupHandler(String urlPath, HttpServletRequest request) throw
Map<String, String> uriTemplateVariables = new LinkedHashMap<String, String>();
for (String matchingPattern : matchingPatterns) {
if (patternComparator.compare(bestPatternMatch, matchingPattern) == 0) {
uriTemplateVariables
.putAll(getPathMatcher().extractUriTemplateVariables(matchingPattern, urlPath));
Map<String, String> vars = getPathMatcher().extractUriTemplateVariables(matchingPattern, urlPath);
Map<String, String> decodedVars = getUrlPathHelper().decodePathVariables(request, vars);
uriTemplateVariables.putAll(decodedVars);
}
}
if (logger.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ private void extractHandlerMethodUriTemplates(String mappedPattern, String looku
int patternVariableCount = StringUtils.countOccurrencesOf(mappedPattern, "{");
if ((variables == null || patternVariableCount != variables.size()) && pathMatcher.match(mappedPattern, lookupPath)) {
variables = pathMatcher.extractUriTemplateVariables(mappedPattern, lookupPath);
request.setAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, variables);
Map<String, String> decodedVariables = urlPathHelper.decodePathVariables(request, variables);
request.setAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, decodedVariables);
}
}
}
Expand Down

0 comments on commit 0105c5e

Please sign in to comment.