Fix issue with extracting matrix variables

The servlet spec recommends removing path parameters from the
contextPath, servletPath, and pathInfo but not from the requestURI.
This poses a challenge for the UrlPathHelper, which determines the
lookup path by comparing the above.

This change introduces a method that matches the requestURI to the
contextPath and servletPath ignoring path parameters (i.e. matrix
variables) for comparison purposes while also preserving them in the
resulting lookup path.
This commit is contained in:
Rossen Stoyanchev
2012-10-29 19:09:00 -04:00
parent 826057bcde
commit d8469d118b
3 changed files with 77 additions and 6 deletions

View File

@@ -116,7 +116,7 @@ public class MatrixVariableMethodArgumentResolver extends AbstractNamedValueMeth
protected void handleMissingValue(String name, MethodParameter param) throws ServletRequestBindingException {
String paramType = param.getParameterType().getName();
throw new ServletRequestBindingException(
"Missing URI path parameter '" + name + "' for method parameter type [" + paramType + "]");
"Missing matrix variable '" + name + "' for method parameter type [" + paramType + "]");
}