DispatcherHandler discovers the delegate components it needs from
Spring configuration. It detects the following in the application context:
HandlerMapping -- map requests to handler objects
HandlerAdapter -- for using any handler interface
HandlerResultHandler -- process handler return values
DispatcherHandler is also designed to be a Spring bean itself and
implements ApplicationContextAware for access to the context it runs
in. If DispatcherHandler is declared as a bean with the name
"webHandler", it is discovered by
WebHttpHandlerBuilder#applicationContext(ApplicationContext) which
puts together a processing chain together with WebFilter,
WebExceptionHandler and others.
A DispatcherHandler bean declaration is included in
@EnableWebFlux
configuration.
WebHttpHandlerBuilder#applicationContext(ApplicationContext)
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private List | |
| private List |
| Access | Constructor and Description |
|---|---|
| public | DispatcherHandler()
Create a new |
| public | DispatcherHandler(ApplicationContext
the application context to find the handler beans in applicationContext)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| private <R> Mono | |
| public final List | Returns: immutable list with the configured mappings ornullReturn all |
| public Mono | handle(ServerWebExchange
the current server exchange exchange)Implements org. Handle the web server exchange. |
| public Mono | handlePreFlight(ServerWebExchange
the exchange for the request exchange)Implements org. Handle a pre-flight request by finding and applying the CORS configuration that matches the expected actual request. |
| private Mono | |
| private Mono | |
| private Mono | |
| protected void | |
| public void | setApplicationContext(ApplicationContext
the ApplicationContext object to be used by this object applicationContext)Implements org. Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object. |
| handlerAdapters | back to summary |
|---|---|
| private List<HandlerAdapter> handlerAdapters
| |
| handlerMappings | back to summary |
|---|---|
| private List<HandlerMapping> handlerMappings
| |
| resultHandlers | back to summary |
|---|---|
| private List<HandlerResultHandler> resultHandlers
| |
| DispatcherHandler | back to summary |
|---|---|
| public DispatcherHandler() Create a new | |
| DispatcherHandler | back to summary |
|---|---|
| public DispatcherHandler(ApplicationContext applicationContext) Create a new
| |
| createNotFoundError | back to summary |
|---|---|
| private <R> Mono | |
| getHandlerMappings | back to summary |
|---|---|
| public final List Return all Note This method may return
| |
| handle | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Handle the web server exchange.
| |
| handlePreFlight | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Handle a pre-flight request by finding and applying the CORS configuration
that matches the expected actual request. As a result of handling, the
response should be updated with CORS headers or rejected with
| |
| handleRequestWith | back to summary |
|---|---|
| private Mono | |
| handleResult | back to summary |
|---|---|
| private Mono | |
| handleResultMono | back to summary |
|---|---|
| private Mono | |
| initStrategies | back to summary |
|---|---|
| protected void initStrategies(ApplicationContext context) | |
| setApplicationContext | back to summary |
|---|---|
| public void setApplicationContext(ApplicationContext applicationContext) Implements org. Doc from org. Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object. Invoked after population of normal bean properties but before an init callback such
as
| |