AbstractReactiveWebInitializer@Deprecated
public abstract class AbstractDispatcherHandlerInitializer
extends java.lang.Object
implements org.springframework.web.WebApplicationInitializer
WebApplicationInitializer
implementations that register a DispatcherHandler in the servlet
context, wrapping it in a ServletHttpHandlerAdapter.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_SERVLET_MAPPING
Deprecated.
The default servlet mapping.
|
static java.lang.String |
DEFAULT_SERVLET_NAME
Deprecated.
The default servlet name.
|
| Constructor and Description |
|---|
AbstractDispatcherHandlerInitializer()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.springframework.context.ApplicationContext |
createApplicationContext()
Deprecated.
Create an application context to be provided to the
DispatcherHandler. |
protected org.springframework.web.server.WebHandler |
createDispatcherHandler(org.springframework.context.ApplicationContext applicationContext)
Deprecated.
Create a
DispatcherHandler (or other kind of WebHandler-derived
dispatcher) with the specified ApplicationContext. |
protected org.springframework.http.server.reactive.ServletHttpHandlerAdapter |
createHandlerAdapter(org.springframework.web.server.WebHandler webHandler)
Deprecated.
Create a
ServletHttpHandlerAdapter. |
protected void |
customizeRegistration(ServletRegistration.Dynamic registration)
Deprecated.
Optionally perform further registration customization once
registerDispatcherHandler(ServletContext) has completed. |
protected java.lang.String |
getServletMapping()
Deprecated.
Specify the servlet mapping for the
ServletHttpHandlerAdapter. |
protected java.lang.String |
getServletName()
Deprecated.
Return the name under which the
ServletHttpHandlerAdapter will be registered. |
void |
onStartup(ServletContext servletContext)
Deprecated.
|
protected void |
refreshApplicationContext(org.springframework.context.ApplicationContext context)
Deprecated.
Refresh the given application context, if necessary.
|
protected void |
registerCloseListener(ServletContext servletContext,
org.springframework.context.ApplicationContext applicationContext)
Deprecated.
Register a
ServletContextListener that closes the given application context
when the servlet context is destroyed. |
protected void |
registerDispatcherHandler(ServletContext servletContext)
Deprecated.
Register a
DispatcherHandler against the given servlet context. |
public static final java.lang.String DEFAULT_SERVLET_NAME
getServletName().public static final java.lang.String DEFAULT_SERVLET_MAPPING
getServletMapping().public AbstractDispatcherHandlerInitializer()
public void onStartup(ServletContext servletContext) throws ServletException
onStartup in interface org.springframework.web.WebApplicationInitializerServletExceptionprotected void registerDispatcherHandler(ServletContext servletContext)
DispatcherHandler against the given servlet context.
This method will create a DispatcherHandler, initializing it with the application
context returned from createApplicationContext(). The created handler will be
wrapped in a ServletHttpHandlerAdapter servlet with the name
returned by getServletName(), mapping it to the pattern
returned from getServletMapping().
Further customization can be achieved by overriding customizeRegistration(ServletRegistration.Dynamic) or
createDispatcherHandler(ApplicationContext).
servletContext - the context to register the servlet againstprotected java.lang.String getServletName()
ServletHttpHandlerAdapter will be registered.
Defaults to DEFAULT_SERVLET_NAME.protected abstract org.springframework.context.ApplicationContext createApplicationContext()
DispatcherHandler.
The returned context is delegated to Spring's
DispatcherHandler.DispatcherHandler(ApplicationContext). As such,
it typically contains controllers, view resolvers, and other web-related beans.
protected void refreshApplicationContext(org.springframework.context.ApplicationContext context)
protected org.springframework.web.server.WebHandler createDispatcherHandler(org.springframework.context.ApplicationContext applicationContext)
DispatcherHandler (or other kind of WebHandler-derived
dispatcher) with the specified ApplicationContext.protected org.springframework.http.server.reactive.ServletHttpHandlerAdapter createHandlerAdapter(org.springframework.web.server.WebHandler webHandler)
ServletHttpHandlerAdapter.
Default implementation returns a ServletHttpHandlerAdapter with the provided
webHandler.
protected java.lang.String getServletMapping()
ServletHttpHandlerAdapter.
Default implementation returns /.
protected void customizeRegistration(ServletRegistration.Dynamic registration)
registerDispatcherHandler(ServletContext) has completed.registration - the ServletHttpHandlerAdapter registration to be customizedregisterDispatcherHandler(ServletContext)protected void registerCloseListener(ServletContext servletContext, org.springframework.context.ApplicationContext applicationContext)
ServletContextListener that closes the given application context
when the servlet context is destroyed.servletContext - the servlet context to listen toapplicationContext - the application context that is to be closed when
servletContext is destroyed