org.springframework.web.context

Interface ConfigurableWebApplicationContext

    • Field Detail

      • APPLICATION_CONTEXT_ID_PREFIX

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

        static final java.lang.String SERVLET_CONFIG_BEAN_NAME
        Name of the ServletConfig environment bean in the factory.
        See Also:
        ServletConfig, Constant Field Values
    • Method Detail

      • setServletContext

        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:
        ConfigurableApplicationContext.refresh()
      • getServletConfig

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

        void setNamespace(@Nullable
                          java.lang.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

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

        void setConfigLocation(java.lang.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

        void setConfigLocations(java.lang.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

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