类 AbstractTemplateView
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.beans.factory.BeanNameAware,cn.taketoday.beans.factory.InitializingBean,cn.taketoday.context.ApplicationContextAware,View
- 直接已知子类:
FreeMarkerView,GroovyMarkupView
JSP/JSTL and other view technologies automatically have access to the HttpServletRequest object and thereby the request/session attributes for the current user. Furthermore, they are able to create and cache helper objects as request attributes themselves.
- 作者:
- Juergen Hoeller, Darren Davison
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private booleanprivate booleanprivate booleanprivate boolean从类继承的字段 cn.taketoday.web.view.AbstractView
DEFAULT_CONTENT_TYPE从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport
applicationContext, log, messageSourceAccessor从接口继承的字段 cn.taketoday.web.view.View
RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected voidapplyContentType(RequestContext response) Apply this view's content type as specified in the "contentType" bean property to the given response.private voidexposeSessionAttributes(Map<String, Object> model, RequestContext context) protected final voidrenderMergedOutputModel(Map<String, Object> model, RequestContext request) Subclasses must implement this method to actually render the view.protected abstract voidrenderMergedTemplateModel(Map<String, Object> model, RequestContext context) Subclasses must implement this method to actually render the view.voidsetAllowRequestOverride(boolean allowRequestOverride) Set whether Request attributes are allowed to override (hide) controller generated model attributes of the same name.voidsetAllowSessionOverride(boolean allowSessionOverride) Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name.voidsetExposeRequestAttributes(boolean exposeRequestAttributes) Set whether all request attributes should be added to the model prior to merging with the template.voidsetExposeSessionAttributes(boolean exposeSessionAttributes) Set whether all HttpSession attributes should be added to the model prior to merging with the template.从类继承的方法 cn.taketoday.web.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString从类继承的方法 cn.taketoday.web.view.AbstractView
addStaticAttribute, createMergedOutputModel, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestContextToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposeOutputRedirectModel, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponse从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
字段详细资料
-
exposeRequestAttributes
private boolean exposeRequestAttributes -
allowRequestOverride
private boolean allowRequestOverride -
exposeSessionAttributes
private boolean exposeSessionAttributes -
allowSessionOverride
private boolean allowSessionOverride
-
-
构造器详细资料
-
AbstractTemplateView
public AbstractTemplateView()
-
-
方法详细资料
-
setExposeRequestAttributes
public void setExposeRequestAttributes(boolean exposeRequestAttributes) Set whether all request attributes should be added to the model prior to merging with the template. Default is "false".Note that some templates may make request attributes visible on their own, e.g. FreeMarker, without exposure in the MVC model.
-
setAllowRequestOverride
public void setAllowRequestOverride(boolean allowRequestOverride) Set whether Request attributes are allowed to override (hide) controller generated model attributes of the same name. Default is "false" which causes an exception to be thrown if request attributes of the same name as model attributes are found. -
setExposeSessionAttributes
public void setExposeSessionAttributes(boolean exposeSessionAttributes) Set whether all HttpSession attributes should be added to the model prior to merging with the template. Default is "false". -
setAllowSessionOverride
public void setAllowSessionOverride(boolean allowSessionOverride) Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name. Default is "false", which causes an exception to be thrown if session attributes of the same name as model attributes are found. -
renderMergedOutputModel
protected final void renderMergedOutputModel(Map<String, Object> model, RequestContext request) 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 request context- 抛出:
Exception- if rendering failed
-
exposeSessionAttributes
-
applyContentType
Apply this view's content type as specified in the "contentType" bean property to the given response.Only applies the view's contentType if no content type has been set on the response before. This allows handlers to override the default content type beforehand.
- 参数:
response- current HTTP response- 另请参阅:
-
renderMergedTemplateModel
protected abstract void renderMergedTemplateModel(Map<String, Object> model, RequestContext context) throws ExceptionSubclasses must implement this method to actually render the view.- 参数:
model- combined output Map, with request attributes and session attributes merged into it if requiredcontext- current HTTP request- 抛出:
Exception- if rendering failed
-