Class AbstractAnnotationConfigMessageDispatcherServletInitializer
- All Implemented Interfaces:
org.springframework.web.WebApplicationInitializer
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.
- Since:
- 2.2
-
Field Summary
Fields inherited from class AbstractMessageDispatcherServletInitializer
DEFAULT_SERVLET_MAPPINGS, DEFAULT_SERVLET_NAMEFields inherited from class org.springframework.web.context.AbstractContextLoaderInitializer
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable org.springframework.web.context.WebApplicationContextprotected org.springframework.web.context.WebApplicationContextCreate a servlet application context to be provided to theMessageDispatcherServlet.protected abstract Class<?>[]protected abstract Class<?>[]Specify@Configurationand/or@Componentclasses to be provided to the dispatcher servlet application context.Methods inherited from class AbstractMessageDispatcherServletInitializer
customizeRegistration, getServletMappings, getServletName, isTransformSchemaLocations, isTransformWsdlLocations, onStartup, registerMessageDispatcherServletMethods inherited from class org.springframework.web.context.AbstractContextLoaderInitializer
getRootApplicationContextInitializers, registerContextLoaderListener
-
Constructor Details
-
AbstractAnnotationConfigMessageDispatcherServletInitializer
public AbstractAnnotationConfigMessageDispatcherServletInitializer()
-
-
Method Details
-
createRootApplicationContext
protected @Nullable org.springframework.web.context.WebApplicationContext createRootApplicationContext()This implementation creates an
AnnotationConfigWebApplicationContext, providing it the annotated classes returned bygetRootConfigClasses(). ReturnsnullifgetRootConfigClasses()returnsnull.- Specified by:
createRootApplicationContextin classorg.springframework.web.context.AbstractContextLoaderInitializer
-
createServletApplicationContext
protected org.springframework.web.context.WebApplicationContext createServletApplicationContext()Create a servlet application context to be provided to theMessageDispatcherServlet.The returned context is delegated to Spring's
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 bygetServletConfigClasses().- Specified by:
createServletApplicationContextin classAbstractMessageDispatcherServletInitializer- See Also:
-
getRootConfigClasses
- Returns:
- the configuration classes for the root application context, or
nullif creation and registration of a root context is not desired
-
getServletConfigClasses
Specify@Configurationand/or@Componentclasses to be provided to the dispatcher servlet application context.- Returns:
- the configuration classes for the dispatcher servlet application context
(may not be empty or
null)
-