Class DispatcherHandler

All Implemented Interfaces:
Aware, ApplicationContextAware, PreFlightRequestHandler, WebHandler

public class DispatcherHandler extends Object implements WebHandler, PreFlightRequestHandler, ApplicationContextAware
Central dispatcher for HTTP request handlers/controllers. Dispatches to registered handlers for processing a request, providing convenient mapping facilities.

DispatcherHandler discovers the delegate components it needs from Spring configuration. It detects the following in the application context:

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.

Rossen Stoyanchev, Sebastien Deleuze, Juergen Hoeller
See Also: