public abstract class AbstractAnnotationConfigMessageDispatcherServletInitializer extends AbstractMessageDispatcherServletInitializer
WebApplicationInitializer implementations that register a
MessageDispatcherServlet configured with annotated classes, e.g. Spring's
@Configuration classes.
Concrete implementations are required to implement getRootConfigClasses()
and getServletConfigClasses() as well as AbstractMessageDispatcherServletInitializer.getServletMappings().
Further template and customization methods are provided by
AbstractDispatcherServletInitializer.
DEFAULT_SERVLET_MAPPINGS, DEFAULT_SERVLET_NAMElogger| Constructor and Description |
|---|
AbstractAnnotationConfigMessageDispatcherServletInitializer() |
| Modifier and Type | Method and Description |
|---|---|
protected WebApplicationContext |
createRootApplicationContext() |
protected WebApplicationContext |
createServletApplicationContext()
Create a servlet application context to be provided to the
MessageDispatcherServlet. |
protected abstract Class<?>[] |
getRootConfigClasses()
|
protected abstract Class<?>[] |
getServletConfigClasses()
Specify
@Configuration
and/or @Component classes to be
provided to the dispatcher servlet
application context. |
customizeRegistration, getServletMappings, getServletName, isTransformSchemaLocations, isTransformWsdlLocations, onStartup, registerMessageDispatcherServletregisterContextLoaderListenerpublic AbstractAnnotationConfigMessageDispatcherServletInitializer()
protected WebApplicationContext createRootApplicationContext()
This implementation creates an AnnotationConfigWebApplicationContext,
providing it the annotated classes returned by getRootConfigClasses().
Returns null if getRootConfigClasses() returns null.
createRootApplicationContext in class AbstractContextLoaderInitializerprotected WebApplicationContext createServletApplicationContext()
MessageDispatcherServlet.
The returned context is delegated to Spring's
MessageDispatcherServlet.MessageDispatcherServlet(WebApplicationContext).
As such, it typically contains endpoints, interceptors and other
web service-related beans.
This implementation creates an AnnotationConfigWebApplicationContext,
providing it the annotated classes returned by getServletConfigClasses().
protected abstract Class<?>[] getRootConfigClasses()
null
if creation and registration of a root context is not desiredprotected abstract Class<?>[] getServletConfigClasses()
@Configuration
and/or @Component classes to be
provided to the dispatcher servlet
application context.null)