类 GroovyMarkupView
java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.view.AbstractView
cn.taketoday.web.view.AbstractUrlBasedView
cn.taketoday.web.view.AbstractTemplateView
cn.taketoday.web.view.groovy.GroovyMarkupView
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.beans.factory.BeanNameAware,cn.taketoday.beans.factory.InitializingBean,cn.taketoday.context.ApplicationContextAware,View
An
AbstractTemplateView subclass based on Groovy XML/XHTML markup templates.
Framework's Groovy Markup Template support requires Groovy 2.3.1 and higher.
- 作者:
- Brian Clozel, Rossen Stoyanchev
- 另请参阅:
-
字段概要
字段从类继承的字段 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 groovy.text.markup.MarkupTemplateEngineAutodetect a MarkupTemplateEngine via the ApplicationContext.booleancheckResource(Locale locale) Check whether the underlying resource that the configured URL points to actually exists.protected groovy.text.TemplategetTemplate(String viewUrl) Return a template compiled by the configured Groovy Markup template engine for the given view URL.protected voidinitApplicationContext(cn.taketoday.context.ApplicationContext context) Invoked at startup.protected voidrenderMergedTemplateModel(Map<String, Object> model, RequestContext context) Subclasses must implement this method to actually render the view.voidsetTemplateEngine(groovy.text.markup.MarkupTemplateEngine engine) Set the MarkupTemplateEngine to use in this view.从类继承的方法 cn.taketoday.web.view.AbstractTemplateView
applyContentType, renderMergedOutputModel, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes从类继承的方法 cn.taketoday.web.view.AbstractUrlBasedView
afterPropertiesSet, 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, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
字段详细资料
-
engine
@Nullable private groovy.text.markup.MarkupTemplateEngine engine
-
-
构造器详细资料
-
GroovyMarkupView
public GroovyMarkupView()
-
-
方法详细资料
-
setTemplateEngine
public void setTemplateEngine(groovy.text.markup.MarkupTemplateEngine engine) Set the MarkupTemplateEngine to use in this view.If not set, the engine is auto-detected by looking up a single
GroovyMarkupConfigbean in the web application context and using it to obtain the configuredMarkupTemplateEngineinstance.- 另请参阅:
-
initApplicationContext
protected void initApplicationContext(cn.taketoday.context.ApplicationContext context) Invoked at startup. If notemplateEnginehas been manually set, this method looks up aGroovyMarkupConfigbean by type and uses it to obtain the Groovy Markup template engine.- 覆盖:
initApplicationContext在类中cn.taketoday.context.support.ApplicationObjectSupport- 另请参阅:
-
autodetectMarkupTemplateEngine
protected groovy.text.markup.MarkupTemplateEngine autodetectMarkupTemplateEngine() throws cn.taketoday.beans.BeansExceptionAutodetect a MarkupTemplateEngine via the ApplicationContext. Called if a MarkupTemplateEngine has not been manually configured.- 抛出:
cn.taketoday.beans.BeansException
-
checkResource
从类复制的说明: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)
-
renderMergedTemplateModel
protected void renderMergedTemplateModel(Map<String, Object> model, RequestContext context) throws Exception从类复制的说明:AbstractTemplateViewSubclasses must implement this method to actually render the view.- 指定者:
renderMergedTemplateModel在类中AbstractTemplateView- 参数:
model- combined output Map, with request attributes and session attributes merged into it if requiredcontext- current HTTP request- 抛出:
Exception- if rendering failed
-
getTemplate
Return a template compiled by the configured Groovy Markup template engine for the given view URL.- 抛出:
Exception
-