org.springframework.web.servlet.view
Class AbstractUrlBasedView
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractView
org.springframework.web.servlet.view.AbstractUrlBasedView
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, View
- Direct Known Subclasses:
- AbstractJasperReportsView, AbstractPdfStamperView, AbstractTemplateView, InternalResourceView, RedirectView, TilesView, XsltView
public abstract class AbstractUrlBasedView
- extends AbstractView
- implements org.springframework.beans.factory.InitializingBean
Abstract base class for URL-based views. Provides a consistent way of
holding the URL that a View wraps, in the form of a "url" bean property.
- Since:
- 13.12.2003
- Author:
- Juergen Hoeller
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
logger |
Method Summary |
void |
afterPropertiesSet()
|
boolean |
checkResource(java.util.Locale locale)
Check whether the underlying resource that the configured URL points to
actually exists. |
java.lang.String |
getUrl()
Return the URL of the resource that this view wraps. |
protected boolean |
isUrlRequired()
Return whether the 'url' property is required. |
void |
setUrl(java.lang.String url)
Set the URL of the resource that this view wraps. |
java.lang.String |
toString()
|
Methods inherited from class org.springframework.web.servlet.view.AbstractView |
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, prepareResponse, render, renderMergedOutputModel, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposePathVariables, setRequestContextAttribute, writeToResponse |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AbstractUrlBasedView
protected AbstractUrlBasedView()
- Constructor for use as a bean.
AbstractUrlBasedView
protected AbstractUrlBasedView(java.lang.String url)
- Create a new AbstractUrlBasedView with the given URL.
- Parameters:
url
- the URL to forward to
setUrl
public void setUrl(java.lang.String url)
- Set the URL of the resource that this view wraps.
The URL must be appropriate for the concrete View implementation.
getUrl
public java.lang.String getUrl()
- Return the URL of the resource that this view wraps.
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
isUrlRequired
protected boolean isUrlRequired()
- Return whether the 'url' property is required.
The default implementation returns true
checkResource
public boolean checkResource(java.util.Locale locale)
throws java.lang.Exception
- Check whether the underlying resource that the configured URL points to
actually exists.
- Parameters:
locale
- the desired Locale that we're looking for
- Returns:
true
if the resource exists (or is assumed to exist);
false
if we know that it does not exist
- Throws:
java.lang.Exception
- if the resource exists but is invalid (e.g. could not be parsed)
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractView