Class DispatcherTypeRequestMatcher
- java.lang.Object
-
- org.springframework.security.web.util.matcher.DispatcherTypeRequestMatcher
-
- All Implemented Interfaces:
RequestMatcher
public class DispatcherTypeRequestMatcher extends java.lang.Object implements RequestMatcher
Checks theDispatcherType
to decide whether to match a given request.HttpServletRequest
. Can also be configured to match a specific HTTP method.- Since:
- 5.5
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
RequestMatcher.MatchResult
-
-
Constructor Summary
Constructors Constructor Description DispatcherTypeRequestMatcher(javax.servlet.DispatcherType dispatcherType)
Creates an instance which matches requests with the providedDispatcherType
DispatcherTypeRequestMatcher(javax.servlet.DispatcherType dispatcherType, org.springframework.http.HttpMethod httpMethod)
Creates an instance which matches requests with the providedDispatcherType
andHttpMethod
-
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
-
Methods inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
matcher
-
-
-
-
Constructor Detail
-
DispatcherTypeRequestMatcher
public DispatcherTypeRequestMatcher(javax.servlet.DispatcherType dispatcherType)
Creates an instance which matches requests with the providedDispatcherType
- 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 providedDispatcherType
andHttpMethod
- Parameters:
dispatcherType
- the type to match againsthttpMethod
- 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 interfaceRequestMatcher
- 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 classjava.lang.Object
-
-