public class VelocityViewResolver
extends org.springframework.web.servlet.view.AbstractTemplateViewResolver
UrlBasedViewResolver
that supports VelocityView (i.e. Velocity templates) and custom subclasses of it.
The view class for all views generated by this resolver can be specified via the "viewClass" property. See UrlBasedViewResolver's javadoc for details.
Note: When chaining ViewResolvers, a VelocityViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found.
UrlBasedViewResolver.setViewClass(java.lang.Class<?>),
UrlBasedViewResolver.setPrefix(java.lang.String),
UrlBasedViewResolver.setSuffix(java.lang.String),
UrlBasedViewResolver.setRequestContextAttribute(java.lang.String),
AbstractTemplateViewResolver.setExposeSpringMacroHelpers(boolean),
setDateToolAttribute(java.lang.String),
setNumberToolAttribute(java.lang.String),
VelocityView| 构造器和说明 |
|---|
VelocityViewResolver() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected org.springframework.web.servlet.view.AbstractUrlBasedView |
buildView(String viewName) |
protected void |
initApplicationContext() |
protected Class<?> |
requiredViewClass()
Requires
VelocityView. |
void |
setDateToolAttribute(String dateToolAttribute)
Set the name of the DateTool helper object to expose in the Velocity context
of this view, or
null if not needed. |
void |
setNumberToolAttribute(String numberToolAttribute)
Set the name of the NumberTool helper object to expose in the Velocity context
of this view, or
null if not needed. |
void |
setToolboxConfigLocation(String toolboxConfigLocation)
Set a Velocity Toolbox config location, for example "/WEB-INF/toolbox.xml",
to automatically load a Velocity Tools toolbox definition file and expose
all defined tools in the specified scopes.
|
setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpersapplyLifecycleMethods, canHandle, createView, getAttributesMap, getCacheKey, getContentType, getExposeContextBeansAsAttributes, getExposedContextBeanNames, getExposePathVariables, getOrder, getPrefix, getRedirectHosts, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, instantiateView, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHosts, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNamesclearCache, getCacheFilter, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCache, setCacheFilter, setCacheLimit, setCacheUnresolvedgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextprotected Class<?> requiredViewClass()
VelocityView.requiredViewClass 在类中 org.springframework.web.servlet.view.AbstractTemplateViewResolverpublic void setDateToolAttribute(String dateToolAttribute)
null if not needed. DateTool is part of Velocity Tools 1.0.dateToolAttribute - dateToolAttributeDateTool,
VelocityView.setDateToolAttribute(java.lang.String)public void setNumberToolAttribute(String numberToolAttribute)
null if not needed. NumberTool is part of Velocity Tools 1.1.numberToolAttribute - numberToolAttributeNumberTool,
VelocityView.setNumberToolAttribute(java.lang.String)public void setToolboxConfigLocation(String toolboxConfigLocation)
The specified location string needs to refer to a ServletContext resource, as expected by ServletToolboxManager which is part of the view package of Velocity Tools.
Note: Specifying a toolbox config location will lead to VelocityToolboxView instances being created.
toolboxConfigLocation - toolboxConfigLocationServletToolboxManager.getInstance(javax.servlet.ServletContext, java.lang.String),
VelocityToolboxView.setToolboxConfigLocation(java.lang.String)protected void initApplicationContext()
initApplicationContext 在类中 org.springframework.web.servlet.view.UrlBasedViewResolverCopyright © 2022. All rights reserved.