Class ServletContextApplicationContextInitializer
java.lang.Object
org.springframework.boot.web.servlet.support.ServletContextApplicationContextInitializer
- All Implemented Interfaces:
org.springframework.context.ApplicationContextInitializer<org.springframework.web.context.ConfigurableWebApplicationContext>
,org.springframework.core.Ordered
public class ServletContextApplicationContextInitializer
extends Object
implements org.springframework.context.ApplicationContextInitializer<org.springframework.web.context.ConfigurableWebApplicationContext>, org.springframework.core.Ordered
ApplicationContextInitializer
for setting the servlet context.- Since:
- 2.0.0
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionServletContextApplicationContextInitializer
(jakarta.servlet.ServletContext servletContext) Create a newServletContextApplicationContextInitializer
instance.ServletContextApplicationContextInitializer
(jakarta.servlet.ServletContext servletContext, boolean addApplicationContextAttribute) Create a newServletContextApplicationContextInitializer
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
void
initialize
(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext) void
setOrder
(int order)
-
Constructor Details
-
ServletContextApplicationContextInitializer
public ServletContextApplicationContextInitializer(jakarta.servlet.ServletContext servletContext) Create a newServletContextApplicationContextInitializer
instance.- Parameters:
servletContext
- the servlet that should be ultimately set.
-
ServletContextApplicationContextInitializer
public ServletContextApplicationContextInitializer(jakarta.servlet.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()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
initialize
public void initialize(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext) - Specified by:
initialize
in interfaceorg.springframework.context.ApplicationContextInitializer<org.springframework.web.context.ConfigurableWebApplicationContext>
-