Class DispatcherTypeRequestMatcher

  • All Implemented Interfaces:
    RequestMatcher

    public class DispatcherTypeRequestMatcher
    extends java.lang.Object
    implements RequestMatcher
    Checks the DispatcherType to decide whether to match a given request. HttpServletRequest. Can also be configured to match a specific HTTP method.
    Since:
    5.5
    • Constructor Summary

      Constructors 
      Constructor Description
      DispatcherTypeRequestMatcher​(javax.servlet.DispatcherType dispatcherType)
      Creates an instance which matches requests with the provided DispatcherType
      DispatcherTypeRequestMatcher​(javax.servlet.DispatcherType dispatcherType, org.springframework.http.HttpMethod httpMethod)
      Creates an instance which matches requests with the provided DispatcherType and HttpMethod
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean matches​(javax.servlet.http.HttpServletRequest request)
      Performs the match against the request's method and dispatcher type.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DispatcherTypeRequestMatcher

        public DispatcherTypeRequestMatcher​(javax.servlet.DispatcherType dispatcherType)
        Creates an instance which matches requests with the provided DispatcherType
        Parameters:
        dispatcherType - the type to match against
      • DispatcherTypeRequestMatcher

        public DispatcherTypeRequestMatcher​(javax.servlet.DispatcherType dispatcherType,
                                            @Nullable
                                            org.springframework.http.HttpMethod httpMethod)
        Creates an instance which matches requests with the provided DispatcherType and HttpMethod
        Parameters:
        dispatcherType - the type to match against
        httpMethod - the HTTP method to match. May be null to match all methods.
    • Method Detail

      • matches

        public boolean matches​(javax.servlet.http.HttpServletRequest request)
        Performs the match against the request's method and dispatcher type.
        Specified by:
        matches in interface RequestMatcher
        Parameters:
        request - the request to check for a match
        Returns:
        true if the http method and dispatcher type align
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object