public class ServletInitializer
extends org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer
ServletInitializer class, Servlet3.0+ container (tomcat here) will
pick up this class and run it automatically. This is the replacement for web.xml.| Constructor | Description |
|---|---|
ServletInitializer() |
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.Class<?>[] |
getRootConfigClasses() |
Specify
@Configuration and/or @Component classes for the
root application context. |
protected java.lang.Class<?>[] |
getServletConfigClasses() |
Specify
@Configuration and/or @Component classes for the
Servlet application context. |
protected java.lang.String[] |
getServletMappings() |
Specify the servlet mapping(s) for the
DispatcherServlet —
for example "/", "/app", etc. |
createRootApplicationContext, createServletApplicationContextgetRootApplicationContextInitializers, registerContextLoaderListenercreateDispatcherServlet, customizeRegistration, getServletApplicationContextInitializers, getServletFilters, getServletName, isAsyncSupported, onStartup, registerDispatcherServlet, registerServletFilterprotected java.lang.Class<?>[] getRootConfigClasses()
@Configuration and/or @Component classes for the
root application context.getRootConfigClasses in class org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializernull
if creation and registration of a root context is not desiredprotected java.lang.Class<?>[] getServletConfigClasses()
@Configuration and/or @Component classes for the
Servlet application context.getServletConfigClasses in class org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializernull if all configuration is specified through root config classes.
Since we only have one dispatcher servlet, we can have only one root context.protected java.lang.String[] getServletMappings()
DispatcherServlet —
for example "/", "/app", etc.getServletMappings in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer