Class ServletContextApplicationContextInitializer
java.lang.Object
org.springframework.boot.web.servlet.support.ServletContextApplicationContextInitializer
- All Implemented Interfaces:
ApplicationContextInitializer<ConfigurableWebApplicationContext>
,Ordered
public class ServletContextApplicationContextInitializer
extends Object
implements ApplicationContextInitializer<ConfigurableWebApplicationContext>, Ordered
ApplicationContextInitializer
for setting the servlet context.- Since:
- 2.0.0
- Author:
- Dave Syer, Phillip Webb
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionServletContextApplicationContextInitializer
(ServletContext servletContext) Create a newServletContextApplicationContextInitializer
instance.ServletContextApplicationContextInitializer
(ServletContext servletContext, boolean addApplicationContextAttribute) Create a newServletContextApplicationContextInitializer
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
void
initialize
(ConfigurableWebApplicationContext applicationContext) void
setOrder
(int order)
-
Constructor Details
-
ServletContextApplicationContextInitializer
Create a newServletContextApplicationContextInitializer
instance.- Parameters:
servletContext
- the servlet that should be ultimately set.
-
ServletContextApplicationContextInitializer
public ServletContextApplicationContextInitializer(ServletContext servletContext, boolean addApplicationContextAttribute) Create a newServletContextApplicationContextInitializer
instance.- Parameters:
servletContext
- the servlet that should be ultimately set.addApplicationContextAttribute
- if theApplicationContext
should be stored as an attribute in theServletContext
- Since:
- 1.3.4
-
-
Method Details
-
setOrder
public void setOrder(int order) -
getOrder
public int getOrder() -
initialize
- Specified by:
initialize
in interfaceApplicationContextInitializer<ConfigurableWebApplicationContext>
-