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
  • Constructor Details

    • ServletContextApplicationContextInitializer

      public ServletContextApplicationContextInitializer(jakarta.servlet.ServletContext servletContext)
      Parameters:
      servletContext - the servlet that should be ultimately set.
    • ServletContextApplicationContextInitializer

      public ServletContextApplicationContextInitializer(jakarta.servlet.ServletContext servletContext, boolean addApplicationContextAttribute)
      Parameters:
      servletContext - the servlet that should be ultimately set.
      addApplicationContextAttribute - if the ApplicationContext should be stored as an attribute in the ServletContext
      Since:
      1.3.4
  • Method Details

    • setOrder

      public void setOrder(int order)
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • initialize

      public void initialize(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext)
      Specified by:
      initialize in interface org.springframework.context.ApplicationContextInitializer<org.springframework.web.context.ConfigurableWebApplicationContext>