public class HandlerMappingIntrospector extends Object implements CorsConfigurationSource
HandlerMapping that would
serve a specific request.
Provides the following methods:
getMatchableHandlerMapping(javax.servlet.http.HttpServletRequest) — obtain a HandlerMapping
to check request-matching criteria against.
getCorsConfiguration(javax.servlet.http.HttpServletRequest) — obtain the CORS configuration for the
request.
| Constructor and Description |
|---|
HandlerMappingIntrospector(ApplicationContext context)
Constructor that detects the configured
HandlerMappings in the
given ApplicationContext or falls back on
"DispatcherServlet.properties" like the DispatcherServlet. |
| Modifier and Type | Method and Description |
|---|---|
CorsConfiguration |
getCorsConfiguration(HttpServletRequest request)
Return a
CorsConfiguration based on the incoming request. |
List<HandlerMapping> |
getHandlerMappings()
Return the configured HandlerMapping's.
|
MatchableHandlerMapping |
getMatchableHandlerMapping(HttpServletRequest request)
Find the
HandlerMapping that would handle the given request and
return it as a MatchableHandlerMapping that can be used to test
request-matching criteria. |
public HandlerMappingIntrospector(ApplicationContext context)
HandlerMappings in the
given ApplicationContext or falls back on
"DispatcherServlet.properties" like the DispatcherServlet.public List<HandlerMapping> getHandlerMappings()
public MatchableHandlerMapping getMatchableHandlerMapping(HttpServletRequest request) throws Exception
HandlerMapping that would handle the given request and
return it as a MatchableHandlerMapping that can be used to test
request-matching criteria.
If the matching HandlerMapping is not an instance of
MatchableHandlerMapping, an IllegalStateException is raised.
request - the current requestnullException - if any of the HandlerMapping's raise an exceptionpublic CorsConfiguration getCorsConfiguration(HttpServletRequest request)
CorsConfigurationSourceCorsConfiguration based on the incoming request.getCorsConfiguration in interface CorsConfigurationSourceCorsConfiguration, or null if none