org.springframework.web.servlet.view
public class: AbstractTemplateViewResolver [javadoc |
source]
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractCachingViewResolver
org.springframework.web.servlet.view.UrlBasedViewResolver
org.springframework.web.servlet.view.AbstractTemplateViewResolver
All Implemented Interfaces:
Ordered, ViewResolver, ServletContextAware, ApplicationContextAware
Direct Known Subclasses:
VelocityLayoutViewResolver, VelocityViewResolver, FreeMarkerViewResolver
Abstract base class for template view resolvers,
in particular for Velocity and FreeMarker views.
Provides a convenient way to specify AbstractTemplateView 's
exposure flags for request attributes, session attributes,
and Spring's macro helpers.
| Methods from org.springframework.web.servlet.view.UrlBasedViewResolver: |
|---|
|
buildView, canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, requiredViewClass, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames |
| Method from org.springframework.web.servlet.view.AbstractTemplateViewResolver Detail: |
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
AbstractTemplateView view = (AbstractTemplateView) super.buildView(viewName);
view.setExposeRequestAttributes(this.exposeRequestAttributes);
view.setAllowRequestOverride(this.allowRequestOverride);
view.setExposeSessionAttributes(this.exposeSessionAttributes);
view.setAllowSessionOverride(this.allowSessionOverride);
view.setExposeSpringMacroHelpers(this.exposeSpringMacroHelpers);
return view;
}
|
protected Class requiredViewClass() {
return AbstractTemplateView.class;
}
|
public void setAllowRequestOverride(boolean allowRequestOverride) {
this.allowRequestOverride = allowRequestOverride;
}
Set whether HttpServletRequest 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. |
public void setAllowSessionOverride(boolean allowSessionOverride) {
this.allowSessionOverride = 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. |
public void setExposeRequestAttributes(boolean exposeRequestAttributes) {
this.exposeRequestAttributes = exposeRequestAttributes;
}
Set whether all request attributes should be added to the
model prior to merging with the template. Default is "false". |
public void setExposeSessionAttributes(boolean exposeSessionAttributes) {
this.exposeSessionAttributes = exposeSessionAttributes;
}
Set whether all HttpSession attributes should be added to the
model prior to merging with the template. Default is "false". |
public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) {
this.exposeSpringMacroHelpers = exposeSpringMacroHelpers;
}
Set whether to expose a RequestContext for use by Spring's macro library,
under the name "springMacroRequestContext". Default is "true". |