Interface ConfigurableWebApplicationContext

All Superinterfaces:
ApplicationContext, ApplicationEventPublisher, AutoCloseable, BeanFactory, Closeable, ConfigurableApplicationContext, EnvironmentCapable, HierarchicalBeanFactory, Lifecycle, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver, WebApplicationContext
All Known Implementing Classes:
AbstractRefreshableWebApplicationContext, AnnotationConfigWebApplicationContext, GenericWebApplicationContext, GroovyWebApplicationContext, StaticWebApplicationContext, XmlWebApplicationContext

public interface ConfigurableWebApplicationContext extends WebApplicationContext, ConfigurableApplicationContext
Interface to be implemented by configurable web application contexts. Supported by ContextLoader and FrameworkServlet.

Note: The setters of this interface need to be called before an invocation of the ConfigurableApplicationContext.refresh() method inherited from ConfigurableApplicationContext. They do not cause an initialization of the context on their own.

Since:
05.12.2003
Author:
Juergen Hoeller
See Also:
  • Field Details Link icon

    • APPLICATION_CONTEXT_ID_PREFIX Link icon

      static final String APPLICATION_CONTEXT_ID_PREFIX
      Prefix for ApplicationContext ids that refer to context path and/or servlet name.
    • SERVLET_CONFIG_BEAN_NAME Link icon

      static final String SERVLET_CONFIG_BEAN_NAME
      Name of the ServletConfig environment bean in the factory.
      See Also:
  • Method Details Link icon

    • setServletContext Link icon

      void setServletContext(@Nullable ServletContext servletContext)
      Set the ServletContext for this web application context.

      Does not cause an initialization of the context: refresh needs to be called after the setting of all configuration properties.

      See Also:
    • setServletConfig Link icon

      void setServletConfig(@Nullable ServletConfig servletConfig)
      Set the ServletConfig for this web application context. Only called for a WebApplicationContext that belongs to a specific Servlet.
      See Also:
    • getServletConfig Link icon

      @Nullable ServletConfig getServletConfig()
      Return the ServletConfig for this web application context, if any.
    • setNamespace Link icon

      void setNamespace(@Nullable String namespace)
      Set the namespace for this web application context, to be used for building a default context config location. The root web application context does not have a namespace.
    • getNamespace Link icon

      @Nullable String getNamespace()
      Return the namespace for this web application context, if any.
    • setConfigLocation Link icon

      void setConfigLocation(String configLocation)
      Set the config locations for this web application context in init-param style, i.e. with distinct locations separated by commas, semicolons or whitespace.

      If not set, the implementation is supposed to use a default for the given namespace or the root web application context, as appropriate.

    • setConfigLocations Link icon

      void setConfigLocations(String... configLocations)
      Set the config locations for this web application context.

      If not set, the implementation is supposed to use a default for the given namespace or the root web application context, as appropriate.

    • getConfigLocations Link icon

      String @Nullable [] getConfigLocations()
      Return the config locations for this web application context, or null if none specified.