java.lang.Object
org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher
All Implemented Interfaces:
RequestMatcher, RequestVariablesExtractor

@Deprecated(forRemoval=true) public class MvcRequestMatcher extends Object implements RequestMatcher, RequestVariablesExtractor
Deprecated, for removal: This API element is subject to removal in a future version.
Please use PathPatternRequestMatcher instead
A 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.

Since:
4.1.1
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Deprecated, for removal: This API element is subject to removal in a future version.
    A builder for MvcRequestMatcher

    Nested classes/interfaces inherited from interface org.springframework.security.web.util.matcher.RequestMatcher

    RequestMatcher.MatchResult
  • Constructor Summary

    Constructors
    Constructor
    Description
    MvcRequestMatcher(org.springframework.web.servlet.handler.HandlerMappingIntrospector introspector, String pattern)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    extractUriTemplateVariables(jakarta.servlet.http.HttpServletRequest request)
    Deprecated.
    protected final String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    matcher(jakarta.servlet.http.HttpServletRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a MatchResult for this RequestMatcher.
    boolean
    matches(jakarta.servlet.http.HttpServletRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Decides whether the rule implemented by the strategy matches the supplied request.
    void
    setMethod(org.springframework.http.HttpMethod method)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setServletPath(String servletPath)
    Deprecated, for removal: This API element is subject to removal in a future version.
    The servlet path to match on.
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MvcRequestMatcher

      public MvcRequestMatcher(org.springframework.web.servlet.handler.HandlerMappingIntrospector introspector, String pattern)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • matches

      public boolean matches(jakarta.servlet.http.HttpServletRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: RequestMatcher
      Decides whether the rule implemented by the strategy matches the supplied request.
      Specified by:
      matches in interface RequestMatcher
      Parameters:
      request - the request to check for a match
      Returns:
      true if the request matches, false otherwise
    • extractUriTemplateVariables

      @Deprecated public Map<String,String> extractUriTemplateVariables(jakarta.servlet.http.HttpServletRequest request)
      Deprecated.
      Description copied from interface: RequestVariablesExtractor
      Extract URL template variables from the request.
      Specified by:
      extractUriTemplateVariables in interface RequestVariablesExtractor
      Parameters:
      request - the HttpServletRequest to obtain a URL to extract the variables from
      Returns:
      the URL variables or empty if no variables are found
    • matcher

      public RequestMatcher.MatchResult matcher(jakarta.servlet.http.HttpServletRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: RequestMatcher
      Returns a MatchResult for this RequestMatcher. The default implementation returns Collections.emptyMap() when RequestMatcher.MatchResult.getVariables() is invoked.
      Specified by:
      matcher in interface RequestMatcher
      Returns:
      the MatchResult from comparing this RequestMatcher against the HttpServletRequest
    • setMethod

      public void setMethod(org.springframework.http.HttpMethod method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      method - the method to set
    • setServletPath

      public void setServletPath(String servletPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      The servlet path to match on. The default is undefined which means any servlet path.
      Parameters:
      servletPath - the servletPath to set
    • getServletPath

      protected final String getServletPath()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • equals

      public boolean equals(Object o)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object