WebApplicationContext.
Provides getWebApplicationContext(), getServletContext(), and
getTempDir() accessors.Note
It is generally recommended to use individual callback interfaces for the actual
callbacks needed. This broad base class is primarily intended for use within the framework,
in case of ServletContext access etc typically being needed.
SpringBeanAutowiringSupport
| Modifier and Type | Field and Description |
|---|---|
| private ServletContext |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected final ServletContext | |
| protected final File | Returns: the File representing the temporary directoryReturn the temporary directory for the current web application, as provided by the servlet container. |
| protected final WebApplicationContext | |
| protected void | initApplicationContext(ApplicationContext
the containing ApplicationContext context)Overrides org. initServletContext(jakarta. if the
given ApplicationContext is a WebApplicationContext.
|
| protected void | initServletContext(ServletContext
the ServletContext that this application object runs in
(never servletContext)null)Subclasses may override this for custom initialization based on the ServletContext that this application object runs in. The default implementation is empty. |
| protected boolean | isContextRequired()
Overrides org. |
| public final void | setServletContext(ServletContext
the ServletContext object to be used by this object servletContext)Implements org. ServletContext that this object runs in.
Invoked after population of normal bean properties but before an init
callback like InitializingBean's |
| servletContext | back to summary |
|---|---|
| private ServletContext servletContext
| |
| WebApplicationObjectSupport | back to summary |
|---|---|
| public WebApplicationObjectSupport() | |
| getServletContext | back to summary |
|---|---|
| protected final ServletContext getServletContext() throws IllegalStateException Return the current ServletContext.
| |
| getTempDir | back to summary |
|---|---|
| protected final File getTempDir() throws IllegalStateException Return the temporary directory for the current web application, as provided by the servlet container.
| |
| getWebApplicationContext | back to summary |
|---|---|
| protected final WebApplicationContext getWebApplicationContext() throws IllegalStateException Return the current application context as WebApplicationContext. Note Only use this if you actually need to access
WebApplicationContext-specific functionality. Preferably use
| |
| initApplicationContext | back to summary |
|---|---|
| protected void initApplicationContext(ApplicationContext context) Overrides org. Calls
| |
| initServletContext | back to summary |
|---|---|
| protected void initServletContext(ServletContext servletContext) Subclasses may override this for custom initialization based on the ServletContext that this application object runs in. The default implementation is empty. Called by
| |
| isContextRequired | back to summary |
|---|---|
| protected boolean isContextRequired() Overrides org. Overrides the base class behavior to enforce running in an ApplicationContext. All accessors will throw IllegalStateException if not running in a context.
| |
| setServletContext | back to summary |
|---|---|
| public final void setServletContext(ServletContext servletContext) Implements org. Doc from org. Set the Invoked after population of normal bean properties but before an init
callback like InitializingBean's
| |