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
ConstructorsConstructorDescriptionServletContextApplicationContextInitializer(jakarta.servlet.ServletContext servletContext) Create a newServletContextApplicationContextInitializerinstance.ServletContextApplicationContextInitializer(jakarta.servlet.ServletContext servletContext, boolean addApplicationContextAttribute) Create a newServletContextApplicationContextInitializerinstance. -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidinitialize(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext) voidsetOrder(int order)
-
Constructor Details
-
ServletContextApplicationContextInitializer
public ServletContextApplicationContextInitializer(jakarta.servlet.ServletContext servletContext) Create a newServletContextApplicationContextInitializerinstance.- Parameters:
servletContext- the servlet that should be ultimately set.
-
ServletContextApplicationContextInitializer
public ServletContextApplicationContextInitializer(jakarta.servlet.ServletContext servletContext, boolean addApplicationContextAttribute) Create a newServletContextApplicationContextInitializerinstance.- Parameters:
servletContext- the servlet that should be ultimately set.addApplicationContextAttribute- if theApplicationContextshould 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:
getOrderin interfaceorg.springframework.core.Ordered
-
initialize
public void initialize(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext) - Specified by:
initializein interfaceorg.springframework.context.ApplicationContextInitializer<org.springframework.web.context.ConfigurableWebApplicationContext>
-