mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-21 13:31:46 +00:00
SPR-6978 - Dispatcher fails to invoke handler method when request method conflicts with request path
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3126 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+4
-1
@@ -637,8 +637,11 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator
|
||||
|
||||
Map<String, String> variables =
|
||||
(Map<String, String>) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
|
||||
|
||||
int patternVariableCount = StringUtils.countOccurrencesOf(mappedPattern, "{");
|
||||
|
||||
if (CollectionUtils.isEmpty(variables) && pathMatcher.match(mappedPattern, lookupPath)) {
|
||||
if ( (variables == null || patternVariableCount != variables.size())
|
||||
&& pathMatcher.match(mappedPattern, lookupPath)) {
|
||||
variables = pathMatcher.extractUriTemplateVariables(mappedPattern, lookupPath);
|
||||
request.setAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, variables);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user