org.springframework.web.context.WebApplicationContext |
Interface to provide configuration for a web application. This is read-only while the application is running, but may be reloaded if the implementation supports this.
This interface adds a getServletContext()
method to the generic
ApplicationContext interface, and defines a well-known application attribute name
that the root context must be bound to in the bootstrap process.
Like generic application contexts, web application contexts are hierarchical. There is a single root context per application, while each servlet in the application (including a dispatcher servlet in the MVC framework) has its own child context.
In addition to standard application context lifecycle capabilities,
WebApplicationContext implementations need to detect ServletContextAware
beans and invoke the setServletContext
method accordingly.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CONTEXT_ATTRIBUTES_BEAN_NAME | Name of the ServletContext/PortletContext attributes environment bean in the factory. | |||||||||
String | CONTEXT_PARAMETERS_BEAN_NAME | Name of the ServletContext/PortletContext init-params environment bean in the factory. | |||||||||
String | SCOPE_APPLICATION | Scope identifier for the global web application scope: "application". | |||||||||
String | SCOPE_GLOBAL_SESSION | Scope identifier for global session scope: "globalSession". | |||||||||
String | SCOPE_REQUEST | Scope identifier for request scope: "request". | |||||||||
String | SCOPE_SESSION | Scope identifier for session scope: "session". | |||||||||
String | SERVLET_CONTEXT_BEAN_NAME | Name of the ServletContext environment bean in the factory. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.beans.factory.BeanFactory
| |||||||||||
From interface
org.springframework.core.io.ResourceLoader
| |||||||||||
From interface
org.springframework.core.io.support.ResourcePatternResolver
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE | Context attribute to bind root WebApplicationContext to on successful startup. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the standard Servlet API ServletContext for this application.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.beans.factory.BeanFactory
| |||||||||||
From interface
org.springframework.beans.factory.HierarchicalBeanFactory
| |||||||||||
From interface
org.springframework.beans.factory.ListableBeanFactory
| |||||||||||
From interface
org.springframework.context.ApplicationContext
| |||||||||||
From interface
org.springframework.context.ApplicationEventPublisher
| |||||||||||
From interface
org.springframework.context.MessageSource
| |||||||||||
From interface
org.springframework.core.env.EnvironmentCapable
| |||||||||||
From interface
org.springframework.core.io.ResourceLoader
| |||||||||||
From interface
org.springframework.core.io.support.ResourcePatternResolver
|
Name of the ServletContext/PortletContext attributes environment bean in the factory.
Name of the ServletContext/PortletContext init-params environment bean in the factory.
Note: Possibly merged with ServletConfig/PortletConfig parameters. ServletConfig parameters override ServletContext parameters of the same name.
Scope identifier for the global web application scope: "application". Supported in addition to the standard scopes "singleton" and "prototype".
Scope identifier for global session scope: "globalSession". Supported in addition to the standard scopes "singleton" and "prototype".
Scope identifier for request scope: "request". Supported in addition to the standard scopes "singleton" and "prototype".
Scope identifier for session scope: "session". Supported in addition to the standard scopes "singleton" and "prototype".
Name of the ServletContext environment bean in the factory.
Context attribute to bind root WebApplicationContext to on successful startup.
Note: If the startup of the root context fails, this attribute can contain an exception or error as value. Use WebApplicationContextUtils for convenient lookup of the root WebApplicationContext.
Return the standard Servlet API ServletContext for this application.
Also available for a Portlet application, in addition to the PortletContext.