public abstract class AbstractReactiveWebInitializer extends java.lang.Object implements WebApplicationInitializer
WebApplicationInitializer
that installs a Spring Reactive Web Application on a Servlet container.
Spring configuration is loaded and given to
WebHttpHandlerBuilder
which scans the context looking for specific beans and creates a reactive
HttpHandler. The resulting handler is installed as a Servlet through
the ServletHttpHandlerAdapter.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_SERVLET_NAME
The default servlet name to use.
|
| Constructor and Description |
|---|
AbstractReactiveWebInitializer() |
| Modifier and Type | Method and Description |
|---|---|
protected ApplicationContext |
createApplicationContext()
Return the Spring configuration that contains application beans including
the ones detected by
WebHttpHandlerBuilder.applicationContext(org.springframework.context.ApplicationContext). |
protected abstract java.lang.Class<?>[] |
getConfigClasses()
Specify
@Configuration and/or
@Component classes that
make up the application configuration. |
protected java.lang.String |
getServletMapping()
Return the Servlet mapping to use.
|
protected java.lang.String |
getServletName()
Return the name to use to register the
ServletHttpHandlerAdapter. |
void |
onStartup(ServletContext servletContext)
Configure the given
ServletContext with any servlets, filters, listeners
context-params and attributes necessary for initializing this web application. |
public static final java.lang.String DEFAULT_SERVLET_NAME
getServletName().public void onStartup(ServletContext servletContext) throws ServletException
WebApplicationInitializerServletContext with any servlets, filters, listeners
context-params and attributes necessary for initializing this web application. See
examples above.onStartup in interface WebApplicationInitializerservletContext - the ServletContext to initializeServletException - if any call against the given ServletContext
throws a ServletExceptionprotected java.lang.String getServletName()
ServletHttpHandlerAdapter.
By default this is DEFAULT_SERVLET_NAME.
protected ApplicationContext createApplicationContext()
WebHttpHandlerBuilder.applicationContext(org.springframework.context.ApplicationContext).protected abstract java.lang.Class<?>[] getConfigClasses()
@Configuration and/or
@Component classes that
make up the application configuration. The config classes are given to
createApplicationContext().protected java.lang.String getServletMapping()
By default this is set to '/'.