Top Description Fields Methods
org.springframework.web.context

public Interface ConfigurableWebApplicationContext

extends WebApplicationContext, ConfigurableApplicationContext
Known Direct Implementers
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext, org.springframework.web.context.support.GenericWebApplicationContext, org.springframework.web.context.support.StaticWebApplicationContext
Imports
jakarta.servlet.ServletConfig, .ServletContext, org.springframework.context.ConfigurableApplicationContext, org.springframework.lang.Nullable

Interface to be implemented by configurable web application contexts. Supported by ContextLoader and org.springframework.web.servlet.FrameworkServlet.

Note

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

Author
Juergen Hoeller
Since
05.12.2003
See Also
refresh, ContextLoader#createWebApplicationContext, org.springframework.web.servlet.FrameworkServlet#createWebApplicationContext

Field Summary

Modifier and TypeField and Description
public static final String
APPLICATION_CONTEXT_ID_PREFIX

Prefix for ApplicationContext ids that refer to context path and/or servlet name.

public static final String
SERVLET_CONFIG_BEAN_NAME

Name of the ServletConfig environment bean in the factory.

Inherited from org.springframework.context.ConfigurableApplicationContext:
APPLICATION_STARTUP_BEAN_NAMECONFIG_LOCATION_DELIMITERSCONVERSION_SERVICE_BEAN_NAMEENVIRONMENT_BEAN_NAMELOAD_TIME_WEAVER_BEAN_NAMESHUTDOWN_HOOK_THREAD_NAMESYSTEM_ENVIRONMENT_BEAN_NAMESYSTEM_PROPERTIES_BEAN_NAME
Inherited from org.springframework.web.context.WebApplicationContext:
CONTEXT_ATTRIBUTES_BEAN_NAMECONTEXT_PARAMETERS_BEAN_NAMEROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTESCOPE_APPLICATIONSCOPE_REQUESTSCOPE_SESSIONSERVLET_CONTEXT_BEAN_NAME

Method Summary

Modifier and TypeMethod and Description
public String[]
getConfigLocations()

Return the config locations for this web application context, or null if none specified.

public String
getNamespace()

Return the namespace for this web application context, if any.

public ServletConfig
getServletConfig()

Return the ServletConfig for this web application context, if any.

public 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.

public void
setConfigLocations(String... configLocations)

Set the config locations for this web application context.

public void
setNamespace(String namespace)

Set the namespace for this web application context, to be used for building a default context config location.

public void
setServletConfig(ServletConfig servletConfig)

Set the ServletConfig for this web application context.

public void
setServletContext(ServletContext servletContext)

Set the ServletContext for this web application context.

Inherited from org.springframework.context.ConfigurableApplicationContext:
addApplicationListeneraddBeanFactoryPostProcessoraddProtocolResolverclosegetApplicationStartupgetBeanFactorygetEnvironmentisActiverefreshregisterShutdownHookremoveApplicationListenersetApplicationStartupsetClassLoadersetEnvironmentsetIdsetParent
Inherited from org.springframework.web.context.WebApplicationContext:
getServletContext

Field Detail

APPLICATION_CONTEXT_ID_PREFIXback to summary
public static final String APPLICATION_CONTEXT_ID_PREFIX

Prefix for ApplicationContext ids that refer to context path and/or servlet name.

SERVLET_CONFIG_BEAN_NAMEback to summary
public static final String SERVLET_CONFIG_BEAN_NAME

Name of the ServletConfig environment bean in the factory.

See Also
jakarta.servlet.ServletConfig

Method Detail

getConfigLocationsback to summary
public String[] getConfigLocations()

Return the config locations for this web application context, or null if none specified.

Annotations
@Nullable
getNamespaceback to summary
public String getNamespace()

Return the namespace for this web application context, if any.

Annotations
@Nullable
getServletConfigback to summary
public ServletConfig getServletConfig()

Return the ServletConfig for this web application context, if any.

Annotations
@Nullable
setConfigLocationback to summary
public 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.

setConfigLocationsback to summary
public 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.

setNamespaceback to summary
public void setNamespace(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.

setServletConfigback to summary
public void setServletConfig(ServletConfig servletConfig)

Set the ServletConfig for this web application context. Only called for a WebApplicationContext that belongs to a specific Servlet.

See Also
refresh()
setServletContextback to summary
public void setServletContext(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
refresh()