public abstract class AbstractUrlBasedView extends AbstractView implements InitializingBean
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
url |
DEFAULT_CONTENT_TYPE
logger
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
Modifier | Constructor and Description |
---|---|
protected |
AbstractUrlBasedView()
Constructor for use as a bean.
|
protected |
AbstractUrlBasedView(java.lang.String url)
Create a new AbstractUrlBasedView with the given URL.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
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() |
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, renderMergedOutputModel, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponse
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
protected AbstractUrlBasedView()
protected AbstractUrlBasedView(java.lang.String url)
url
- the URL to forward topublic void setUrl(java.lang.String url)
public java.lang.String getUrl()
public void afterPropertiesSet() throws java.lang.Exception
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
java.lang.Exception
- in the event of misconfiguration (such
as failure to set an essential property) or if initialization fails.protected boolean isUrlRequired()
The default implementation returns true
.
This can be overridden in subclasses.
public boolean checkResource(java.util.Locale locale) throws java.lang.Exception
locale
- the desired Locale that we're looking fortrue
if the resource exists (or is assumed to exist);
false
if we know that it does not existjava.lang.Exception
- if the resource exists but is invalid (e.g. could not be parsed)public java.lang.String toString()
toString
in class AbstractView