public abstract class AbstractHandlerMapping extends org.springframework.context.support.ApplicationObjectSupport implements HandlerMapping, org.springframework.core.Ordered
HandlerMapping
implementations.BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE| Constructor and Description |
|---|
AbstractHandlerMapping() |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.web.cors.CorsConfiguration |
getCorsConfiguration(java.lang.Object handler,
org.springframework.web.server.ServerWebExchange exchange)
Retrieve the CORS configuration for the given handler.
|
org.springframework.web.cors.reactive.CorsProcessor |
getCorsProcessor()
Return the configured
CorsProcessor. |
reactor.core.publisher.Mono<java.lang.Object> |
getHandler(org.springframework.web.server.ServerWebExchange exchange)
Return a handler for this request.
|
protected abstract reactor.core.publisher.Mono<?> |
getHandlerInternal(org.springframework.web.server.ServerWebExchange exchange)
Look up a handler for the given request, returning an empty
Mono
if no specific one is found. |
int |
getOrder() |
org.springframework.web.util.pattern.PathPatternParser |
getPathPatternParser()
Return the
PathPatternParser instance. |
void |
setCorsConfigurations(java.util.Map<java.lang.String,org.springframework.web.cors.CorsConfiguration> corsConfigurations)
Set "global" CORS configuration based on URL patterns.
|
void |
setCorsProcessor(org.springframework.web.cors.reactive.CorsProcessor corsProcessor)
Configure a custom
CorsProcessor to use to apply the matched
CorsConfiguration for a request. |
void |
setOrder(int order)
Specify the order value for this HandlerMapping bean.
|
void |
setUseCaseSensitiveMatch(boolean caseSensitiveMatch)
Whether to match to URLs irrespective of their case.
|
void |
setUseTrailingSlashMatch(boolean trailingSlashMatch)
Whether to match to URLs irrespective of the presence of a trailing slash.
|
public final void setOrder(int order)
Default value is Integer.MAX_VALUE, meaning that it's non-ordered.
Ordered.getOrder()public final int getOrder()
getOrder in interface org.springframework.core.Orderedpublic void setUseCaseSensitiveMatch(boolean caseSensitiveMatch)
The default value is false.
public void setUseTrailingSlashMatch(boolean trailingSlashMatch)
The default value is true.
public org.springframework.web.util.pattern.PathPatternParser getPathPatternParser()
PathPatternParser instance.public void setCorsConfigurations(java.util.Map<java.lang.String,org.springframework.web.cors.CorsConfiguration> corsConfigurations)
public void setCorsProcessor(org.springframework.web.cors.reactive.CorsProcessor corsProcessor)
CorsProcessor to use to apply the matched
CorsConfiguration for a request.
By default an instance of DefaultCorsProcessor is used.
public org.springframework.web.cors.reactive.CorsProcessor getCorsProcessor()
CorsProcessor.public reactor.core.publisher.Mono<java.lang.Object> getHandler(org.springframework.web.server.ServerWebExchange exchange)
HandlerMappinggetHandler in interface HandlerMappingexchange - current server exchangeMono that emits one value or none in case the request
cannot be resolved to a handlerprotected abstract reactor.core.publisher.Mono<?> getHandlerInternal(org.springframework.web.server.ServerWebExchange exchange)
Mono
if no specific one is found. This method is called by getHandler(org.springframework.web.server.ServerWebExchange).
On CORS pre-flight requests this method should return a match not for
the pre-flight request but for the expected actual request based on the URL
path, the HTTP methods from the "Access-Control-Request-Method" header, and
the headers from the "Access-Control-Request-Headers" header thus allowing
the CORS configuration to be obtained via #getCorsConfigurations,
exchange - current exchangeMono for the matching handler, if any@Nullable
protected org.springframework.web.cors.CorsConfiguration getCorsConfiguration(java.lang.Object handler,
org.springframework.web.server.ServerWebExchange exchange)
handler - the handler to check (never null)exchange - the current exchangenull if none