public class MvcRequestMatcher extends Object implements RequestMatcher, RequestVariablesExtractor
RequestMatcher that uses Spring MVC's HandlerMappingIntrospector to
match the path and extract variables.
It is important to understand that Spring MVC's matching is relative to the servlet
path. This means if you have mapped any servlet to a path that starts with "/" and is
greater than one, you should also specify the setServletPath(String) attribute
to differentiate mappings.
| Constructor and Description |
|---|
MvcRequestMatcher(HandlerMappingIntrospector introspector,
String pattern) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
extractUriTemplateVariables(javax.servlet.http.HttpServletRequest request)
Extract URL template variables from the request.
|
protected String |
getServletPath() |
boolean |
matches(javax.servlet.http.HttpServletRequest request)
Decides whether the rule implemented by the strategy matches the supplied request.
|
void |
setMethod(HttpMethod method) |
void |
setServletPath(String servletPath)
The servlet path to match on.
|
public MvcRequestMatcher(HandlerMappingIntrospector introspector, String pattern)
public boolean matches(javax.servlet.http.HttpServletRequest request)
RequestMatchermatches in interface RequestMatcherrequest - the request to check for a matchpublic Map<String,String> extractUriTemplateVariables(javax.servlet.http.HttpServletRequest request)
RequestVariablesExtractorextractUriTemplateVariables in interface RequestVariablesExtractorrequest - the HttpServletRequest to obtain a URL to extract the variables frompublic void setMethod(HttpMethod method)
method - the method to setpublic void setServletPath(String servletPath)
servletPath - the servletPath to setprotected final String getServletPath()