org.springframework.web.reactive.HandlerMapping implementations.
Supports direct matches, e.g. a registered "/test" matches "/test", and
various path pattern matches, e.g. a registered "/t*" pattern matches
both "/test" and "/team", "/test/*" matches all paths under "/test",
"/test/**" matches all paths below "/test". For details, see the
org. javadoc.
Will search all path patterns to find the most specific match for the current request path. The most specific pattern is defined as the longest path pattern with the fewest captured variables and wildcards.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private BiPredicate | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| public Mono | getHandlerInternal(ServerWebExchange
current exchange exchange)Implements abstract org. Look up a handler for the given request, returning an empty |
| public final Map | getHandlerMap()
Return a read-only view of registered path patterns and handlers which may be an actual handler instance or the bean name of lazily initialized handler. |
| protected Object | Returns: the associated handler instance, ornull if not foundthe URL the handler is mapped to lookupPath, ServerWebExchange the current exchange exchange)Look up a handler instance for the given URL lookup path. |
| protected void | registerHandler(String[]
the URLs that the bean should be mapped to urlPaths, String the name of the handler bean beanName)Register the specified handler for the given URL paths. |
| protected void | registerHandler(String
the URL the bean should be mapped to urlPath, Object the handler instance or handler bean name String
(a bean name will automatically be resolved into the corresponding handler bean) handler)Register the specified handler for the given URL path. |
| public void | setHandlerPredicate(BiPredicate<Object, ServerWebExchange>
a bi-predicate to match the candidate handler
against the current exchange. handlerPredicate)Configure a predicate for extended matching of the handler that was matched by URL path. |
| public void | |
| protected void | validateHandler(Object
the handler object to validate handler, ServerWebExchange current exchange exchange)Validate the given handler against the current request. |
| handlerMap | back to summary |
|---|---|
| private final Map<PathPattern, Object> handlerMap | |
| handlerPredicate | back to summary |
|---|---|
| private BiPredicate<Object, ServerWebExchange> handlerPredicate
| |
| lazyInitHandlers | back to summary |
|---|---|
| private boolean lazyInitHandlers | |
| AbstractUrlHandlerMapping | back to summary |
|---|---|
| public AbstractUrlHandlerMapping() | |
| getHandlerDescription | back to summary |
|---|---|
| private String getHandlerDescription(Object handler) | |
| getHandlerInternal | back to summary |
|---|---|
| public Mono Implements abstract org. Doc from org. Look up a handler for the given request, returning an empty 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.
| |
| getHandlerMap | back to summary |
|---|---|
| public final Map Return a read-only view of registered path patterns and handlers which may be an actual handler instance or the bean name of lazily initialized handler. | |
| lookupHandler | back to summary |
|---|---|
| protected Object lookupHandler(PathContainer lookupPath, ServerWebExchange exchange) throws Exception Look up a handler instance for the given URL lookup path. Supports direct matches, e.g. a registered "/test" matches "/test", and various path pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the PathPattern class.
| |
| registerHandler | back to summary |
|---|---|
| protected void registerHandler(String[] urlPaths, String beanName) throws BeansException, IllegalStateException Register the specified handler for the given URL paths.
| |
| registerHandler | back to summary |
|---|---|
| protected void registerHandler(String urlPath, Object handler) throws BeansException, IllegalStateException Register the specified handler for the given URL path.
| |
| setHandlerPredicate | back to summary |
|---|---|
| public void setHandlerPredicate(BiPredicate<Object, ServerWebExchange> handlerPredicate) Configure a predicate for extended matching of the handler that was
matched by URL path. This allows for further narrowing of the mapping by
checking additional properties of the request. If the predicate returns
"false", it result in a no-match, which allows another
| |
| setLazyInitHandlers | back to summary |
|---|---|
| public void setLazyInitHandlers(boolean lazyInitHandlers) Set whether to lazily initialize handlers. Only applicable to singleton handlers, as prototypes are always lazily initialized. Default is "false", as eager initialization allows for more efficiency through referencing the controller objects directly. If you want to allow your controllers to be lazily initialized, make them "lazy-init" and set this flag to true. Just making them "lazy-init" will not work, as they are initialized through the references from the handler mapping in this case. | |
| validateHandler | back to summary |
|---|---|
| protected void validateHandler(Object handler, ServerWebExchange exchange) Validate the given handler against the current request. The default implementation is empty. Can be overridden in subclasses, for example to enforce specific preconditions expressed in URL mappings.
| |