|
spring-webmvc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.context.AbstractContextLoaderInitializer
org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer
public abstract class AbstractAnnotationConfigDispatcherServletInitializer
Base class for WebApplicationInitializer
implementations that register a DispatcherServlet
configured with annotated classes, e.g. Spring's @Configuration
classes.
Concrete implementations are required to implement getRootConfigClasses()
,
getServletConfigClasses()
, as well as AbstractDispatcherServletInitializer.getServletMappings()
. Further
template and customization methods are provided by AbstractDispatcherServletInitializer
.
Field Summary |
---|
Fields inherited from class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer |
---|
DEFAULT_SERVLET_NAME |
Fields inherited from class org.springframework.web.context.AbstractContextLoaderInitializer |
---|
logger |
Constructor Summary | |
---|---|
AbstractAnnotationConfigDispatcherServletInitializer()
|
Method Summary | |
---|---|
protected org.springframework.web.context.WebApplicationContext |
createRootApplicationContext()
|
protected org.springframework.web.context.WebApplicationContext |
createServletApplicationContext()
Create a servlet application context to be provided to the DispatcherServlet . |
protected abstract java.lang.Class<?>[] |
getRootConfigClasses()
Specify @Configuration
and/or @Component classes to be
provided to the root application context. |
protected abstract java.lang.Class<?>[] |
getServletConfigClasses()
Specify @Configuration
and/or @Component classes to be
provided to the dispatcher servlet
application context. |
Methods inherited from class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer |
---|
customizeRegistration, getServletMappings, getServletName, onStartup, registerDispatcherServlet |
Methods inherited from class org.springframework.web.context.AbstractContextLoaderInitializer |
---|
registerContextLoaderListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAnnotationConfigDispatcherServletInitializer()
Method Detail |
---|
protected org.springframework.web.context.WebApplicationContext createRootApplicationContext()
This implementation creates an AnnotationConfigWebApplicationContext
,
providing it the annotated classes returned by getRootConfigClasses()
.
Returns null
if getRootConfigClasses()
returns null
.
createRootApplicationContext
in class org.springframework.web.context.AbstractContextLoaderInitializer
protected org.springframework.web.context.WebApplicationContext createServletApplicationContext()
DispatcherServlet
.
The returned context is delegated to Spring's
DispatcherServlet.DispatcherServlet(WebApplicationContext)
As such, it
typically contains controllers, view resolvers, locale resolvers, and other
web-related beans.
This implementation creates an AnnotationConfigWebApplicationContext
,
providing it the annotated classes returned by getServletConfigClasses()
.
createServletApplicationContext
in class AbstractDispatcherServletInitializer
java.lang.IllegalArgumentException
- if getServletConfigClasses()
returns
empty or null
AbstractDispatcherServletInitializer.registerDispatcherServlet(ServletContext)
protected abstract java.lang.Class<?>[] getRootConfigClasses()
@Configuration
and/or @Component
classes to be
provided to the root application context.
null
if creation and registration of a root context is not desiredprotected abstract java.lang.Class<?>[] getServletConfigClasses()
@Configuration
and/or @Component
classes to be
provided to the dispatcher servlet
application context.
null
).
|
spring-webmvc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |