org.springframework.boot.web.servlet.support

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
    Author:
    Dave Syer, Phillip Webb
    • Constructor Detail

      • ServletContextApplicationContextInitializer

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

        public ServletContextApplicationContextInitializer(javax.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 Detail

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

Copyright © 2018 Pivotal Software, Inc.. All rights reserved.