类 TilesView
public class TilesView extends AbstractUrlBasedView
Viewimplementation that renders through the Tiles Request API. The "url" property is interpreted as name of a Tiles definition.- 从以下版本开始:
- 3.2
- 作者:
- Nicolas Le Bas, mick semb wever, Rossen Stoyanchev, Sebastien Deleuze
字段概要
从类继承的字段 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
构造器概要
构造器 构造器 说明 TilesView()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterPropertiesSet()Invoked 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.protected RequestcreateTilesRequest(HttpServletRequest request, HttpServletResponse response)Create a TilesRequest.protected voidrenderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)Subclasses must implement this method to actually render the view.voidsetAlwaysInclude(boolean alwaysInclude)Specify whether to always include the view rather than forward to it.protected voidsetExposeJstlAttributes(boolean exposeJstlAttributes)Whether to expose JSTL attributes.voidsetRenderer(Renderer renderer)Set theRendererto use.从类继承的方法 org.springframework.web.servlet.view.AbstractUrlBasedView
getUrl, isUrlRequired, setUrl, toString
从类继承的方法 org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, 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
构造器详细资料
TilesView
public TilesView()
方法详细资料
setRenderer
public void setRenderer(Renderer renderer)
Set theRendererto use. If not set, by defaultDefinitionRendereris used.
setExposeJstlAttributes
protected void setExposeJstlAttributes(boolean exposeJstlAttributes)
Whether to expose JSTL attributes. By default set totrue.
setAlwaysInclude
public void setAlwaysInclude(boolean alwaysInclude)
Specify whether to always include the view rather than forward to it.Default is "false". Switch this flag on to enforce the use of a Servlet include, even if a forward would be possible.
- 从以下版本开始:
- 4.1.2
- 另请参阅:
TilesViewResolver.setAlwaysInclude(java.lang.Boolean)
afterPropertiesSet
public void afterPropertiesSet() throws Exception
从接口复制的说明: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.
- 指定者:
afterPropertiesSet在接口中InitializingBean- 覆盖:
afterPropertiesSet在类中AbstractUrlBasedView- 抛出:
Exception- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
checkResource
public boolean checkResource(Locale locale) throws Exception
从类复制的说明:AbstractUrlBasedViewCheck whether the underlying resource that the configured URL points to actually exists.- 覆盖:
checkResource在类中AbstractUrlBasedView- 参数:
locale- the desired Locale that we're looking for- 返回:
trueif the resource exists (or is assumed to exist);falseif we know that it does not exist- 抛出:
Exception- if the resource exists but is invalid (e.g. could not be parsed)
renderMergedOutputModel
protected void renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception
从类复制的说明:AbstractViewSubclasses must implement this method to actually render the view.The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.
- 指定者:
renderMergedOutputModel在类中AbstractView- 参数:
model- combined output Map (nevernull), with dynamic values taking precedence over static attributesrequest- current HTTP requestresponse- current HTTP response- 抛出:
Exception- if rendering failed
createTilesRequest
protected Request createTilesRequest(HttpServletRequest request, HttpServletResponse response)
Create a TilesRequest.This implementation creates a
ServletRequest.- 参数:
request- the current requestresponse- the current response- 返回:
- the Tiles request