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:
- Aware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ServletContextAware,- View
- Direct Known Subclasses:
- AbstractPdfStamperView,- AbstractTemplateView,- InternalResourceView,- RedirectView,- ScriptTemplateView,- XsltView
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
- 
Field SummaryFields inherited from class org.springframework.web.servlet.view.AbstractViewDEFAULT_CONTENT_TYPEFields inherited from class org.springframework.context.support.ApplicationObjectSupportloggerFields inherited from interface org.springframework.web.servlet.ViewPATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructor for use as a bean.protectedCreate a new AbstractUrlBasedView with the given URL.
- 
Method SummaryModifier and TypeMethodDescriptionvoidInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.booleancheckResource(Locale locale) Check whether the underlying resource that the configured URL points to actually exists.getUrl()Return the URL of the resource that this view wraps.protected booleanReturn whether the 'url' property is required.voidSet the URL of the resource that this view wraps.toString()Methods inherited from class org.springframework.web.servlet.view.AbstractViewaddStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, renderMergedOutputModel, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponseMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupportgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupportgetApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
- 
Constructor Details- 
AbstractUrlBasedViewprotected AbstractUrlBasedView()Constructor for use as a bean.
- 
AbstractUrlBasedViewCreate a new AbstractUrlBasedView with the given URL.- Parameters:
- url- the URL to forward to
 
 
- 
- 
Method Details- 
setUrlSet the URL of the resource that this view wraps. The URL must be appropriate for the concrete View implementation.
- 
getUrlReturn the URL of the resource that this view wraps.
- 
afterPropertiesSetDescription copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set. - Specified by:
- afterPropertiesSetin interface- InitializingBean
- Throws:
- Exception- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
 
- 
isUrlRequiredprotected boolean isUrlRequired()Return whether the 'url' property is required.The default implementation returns true. This can be overridden in subclasses.
- 
checkResourceCheck whether the underlying resource that the configured URL points to actually exists.- Parameters:
- locale- the desired Locale that we're looking for
- Returns:
- trueif the resource exists (or is assumed to exist);- falseif we know that it does not exist
- Throws:
- Exception- if the resource exists but is invalid (for example, could not be parsed)
 
- 
toString- Overrides:
- toStringin class- AbstractView
 
 
-