Class AbstractRequestMatcherRegistry<C>
java.lang.Object
org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry<C>
- Type Parameters:
C
- The object that is returned or Chained after creating the RequestMatcher
- Direct Known Subclasses:
AbstractConfigAttributeRequestMatcherRegistry
,AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry
,HttpSecurity.RequestMatcherConfigurer
,WebSecurity.IgnoredRequestConfigurer
A base class for registering
RequestMatcher
's. For example, it might allow for
specifying which RequestMatcher
require a certain level of authorization.- Since:
- 3.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMaps any request.protected abstract C
chainRequestMatchers
(List<RequestMatcher> requestMatchers) Subclasses should implement this method for returning the object that is chained to the creation of theRequestMatcher
instances.dispatcherTypeMatchers
(jakarta.servlet.DispatcherType... dispatcherTypes) dispatcherTypeMatchers
(org.springframework.http.HttpMethod method, jakarta.servlet.DispatcherType... dispatcherTypes) Maps aList
ofDispatcherTypeRequestMatcher
instances.protected final org.springframework.context.ApplicationContext
Gets theApplicationContext
requestMatchers
(String... patterns) Match when the request URI matches one ofpatterns
.requestMatchers
(org.springframework.http.HttpMethod method) Match when theHttpMethod
ismethod
requestMatchers
(org.springframework.http.HttpMethod method, String... patterns) Match when theHttpMethod
ismethod
and when the request URI matches one ofpatterns
.requestMatchers
(RequestMatcher... requestMatchers) Associates a list ofRequestMatcher
instances with theAbstractRequestMatcherRegistry
protected final void
setApplicationContext
(org.springframework.context.ApplicationContext context)
-
Constructor Details
-
AbstractRequestMatcherRegistry
public AbstractRequestMatcherRegistry()
-
-
Method Details
-
setApplicationContext
protected final void setApplicationContext(org.springframework.context.ApplicationContext context) -
getApplicationContext
protected final org.springframework.context.ApplicationContext getApplicationContext()Gets theApplicationContext
- Returns:
- the
ApplicationContext
-
anyRequest
Maps any request.- Returns:
- the object that is chained after creating the
RequestMatcher
-
dispatcherTypeMatchers
public C dispatcherTypeMatchers(@Nullable org.springframework.http.HttpMethod method, jakarta.servlet.DispatcherType... dispatcherTypes) Maps aList
ofDispatcherTypeRequestMatcher
instances.- Parameters:
method
- theHttpMethod
to use ornull
for anyHttpMethod
.dispatcherTypes
- the dispatcher types to match against- Returns:
- the object that is chained after creating the
RequestMatcher
-
dispatcherTypeMatchers
- Parameters:
dispatcherTypes
- the dispatcher types to match against- Returns:
- the object that is chained after creating the
RequestMatcher
-
requestMatchers
Associates a list ofRequestMatcher
instances with theAbstractRequestMatcherRegistry
- Parameters:
requestMatchers
- theRequestMatcher
instances- Returns:
- the object that is chained after creating the
RequestMatcher
-
requestMatchers
Match when the
HttpMethod
ismethod
and when the request URI matches one ofpatterns
. SeePathPattern
for matching rules.If a specific
RequestMatcher
must be specified, userequestMatchers(RequestMatcher...)
instead- Parameters:
method
- theHttpMethod
to use ornull
for anyHttpMethod
.patterns
- the patterns to match on- Returns:
- the object that is chained after creating the
RequestMatcher
. - Since:
- 5.8
-
requestMatchers
Match when the request URI matches one of
patterns
. SeePathPattern
for matching rules.If a specific
RequestMatcher
must be specified, userequestMatchers(RequestMatcher...)
instead- Parameters:
patterns
- the patterns to match on- Returns:
- the object that is chained after creating the
RequestMatcher
. - Since:
- 5.8
-
requestMatchers
Match when the
HttpMethod
ismethod
If a specific
RequestMatcher
must be specified, userequestMatchers(RequestMatcher...)
instead- Parameters:
method
- theHttpMethod
to use ornull
for anyHttpMethod
.- Returns:
- the object that is chained after creating the
RequestMatcher
. - Since:
- 5.8
-
chainRequestMatchers
Subclasses should implement this method for returning the object that is chained to the creation of theRequestMatcher
instances.- Parameters:
requestMatchers
- theRequestMatcher
instances that were created- Returns:
- the chained Object for the subclass which allows association of something
else to the
RequestMatcher
-