类 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
- 直接已知子类:
AbstractPdfStamperView
,AbstractTemplateView
,InternalResourceView
,RedirectView
,ScriptTemplateView
,TilesView
,XsltView
public abstract class AbstractUrlBasedView extends AbstractView implements 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.- 从以下版本开始:
- 13.12.2003
- 作者:
- Juergen Hoeller
字段概要
从类继承的字段 org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
从接口继承的字段 org.springframework.web.servlet.View
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
构造器概要
构造器 限定符 构造器 说明 protected
AbstractUrlBasedView()
Constructor for use as a bean.protected
AbstractUrlBasedView(String url)
Create a new AbstractUrlBasedView with the given URL.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.boolean
checkResource(Locale locale)
Check whether the underlying resource that the configured URL points to actually exists.String
getUrl()
Return the URL of the resource that this view wraps.protected boolean
isUrlRequired()
Return whether the 'url' property is required.void
setUrl(String url)
Set the URL of the resource that this view wraps.String
toString()
从类继承的方法 org.springframework.web.servlet.view.AbstractView
addStaticAttribute, 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, writeToResponse
从类继承的方法 org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
构造器详细资料
AbstractUrlBasedView
protected AbstractUrlBasedView()
Constructor for use as a bean.
AbstractUrlBasedView
protected AbstractUrlBasedView(String url)
Create a new AbstractUrlBasedView with the given URL.- 参数:
url
- the URL to forward to
方法详细资料
setUrl
public void setUrl(@Nullable String url)
Set the URL of the resource that this view wraps. The URL must be appropriate for the concrete View implementation.
afterPropertiesSet
public void afterPropertiesSet() throws Exception
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
Exception
- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
isUrlRequired
protected boolean isUrlRequired()
Return whether the 'url' property is required.The default implementation returns
true
. This can be overridden in subclasses.
checkResource
public boolean checkResource(Locale locale) throws Exception
Check whether the underlying resource that the configured URL points to actually exists.- 参数:
locale
- the desired Locale that we're looking for- 返回:
true
if the resource exists (or is assumed to exist);false
if we know that it does not exist- 抛出:
Exception
- if the resource exists but is invalid (e.g. could not be parsed)
toString
public String toString()
- 覆盖:
toString
在类中AbstractView