org.springframework.web.context.support
Class WebApplicationObjectSupport
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
- All Implemented Interfaces:
- ApplicationContextAware
- Direct Known Subclasses:
- AbstractCachingViewResolver, AbstractHandlerMapping, AbstractView, BeanNameViewResolver, TilesConfigurer, WebContentGenerator
public abstract class WebApplicationObjectSupport
- extends ApplicationObjectSupport
Convenient superclass for application objects running in a WebApplicationContext.
Provides getWebApplicationContext, getServletContext, and getTempDir methods.
- Since:
- 28.08.2003
- Author:
- Juergen Hoeller
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebApplicationObjectSupport
public WebApplicationObjectSupport()
isContextRequired
protected boolean isContextRequired()
- Overrides the base class behavior to enforce running in an ApplicationContext.
All accessors will throw IllegalStateException if not running in a context.
- Overrides:
isContextRequired
in class ApplicationObjectSupport
- See Also:
ApplicationObjectSupport.getApplicationContext()
,
ApplicationObjectSupport.getMessageSourceAccessor()
,
getWebApplicationContext()
,
getServletContext()
,
getTempDir()
getWebApplicationContext
protected final WebApplicationContext getWebApplicationContext()
throws IllegalStateException
- Return the current application context as WebApplicationContext.
- Throws:
IllegalStateException
- if not running in a WebApplicationContext
getServletContext
protected final ServletContext getServletContext()
- Return the current ServletContext.
- Throws:
IllegalStateException
- if not running in a WebApplicationContext
getTempDir
protected final File getTempDir()
- Return the temporary directory for the current web application,
as provided by the servlet container.
- Returns:
- the File representing the temporary directory
- Throws:
IllegalStateException
- if not running in a WebApplicationContext
Copyright (c) 2002-2005 The Spring Framework Project.