spring-framework / org.springframework.web.servlet.view / AbstractTemplateViewResolver

AbstractTemplateViewResolver

open class AbstractTemplateViewResolver : UrlBasedViewResolver

Abstract base class for template view resolvers, in particular for FreeMarker views.

Provides a convenient way to specify AbstractTemplateView's exposure flags for request attributes, session attributes, and Spring's macro helpers.

Author
Juergen Hoeller

Since
1.1

See Also
AbstractTemplateVieworg.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver

Constructors

<init>

AbstractTemplateViewResolver()

Abstract base class for template view resolvers, in particular for FreeMarker views.

Provides a convenient way to specify AbstractTemplateView's exposure flags for request attributes, session attributes, and Spring's macro helpers.

Functions

setAllowRequestOverride

open fun setAllowRequestOverride(allowRequestOverride: Boolean): Unit

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.

setAllowSessionOverride

open fun setAllowSessionOverride(allowSessionOverride: Boolean): Unit

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.

setExposeRequestAttributes

open fun setExposeRequestAttributes(exposeRequestAttributes: Boolean): Unit

Set whether all request attributes should be added to the model prior to merging with the template. Default is "false".

setExposeSessionAttributes

open fun setExposeSessionAttributes(exposeSessionAttributes: Boolean): Unit

Set whether all HttpSession attributes should be added to the model prior to merging with the template. Default is "false".

setExposeSpringMacroHelpers

open fun setExposeSpringMacroHelpers(exposeSpringMacroHelpers: Boolean): Unit

Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext". Default is "true".

Inheritors

FreeMarkerViewResolver

open class FreeMarkerViewResolver : AbstractTemplateViewResolver

Convenience subclass of org.springframework.web.servlet.view.UrlBasedViewResolver that supports FreeMarkerView (i.e. FreeMarker 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 FreeMarkerViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found.

GroovyMarkupViewResolver

open class GroovyMarkupViewResolver : AbstractTemplateViewResolver

Convenience subclass of @link AbstractTemplateViewResolver} that supports GroovyMarkupView (i.e. Groovy XML/XHTML markup templates) and custom subclasses of it.

The view class for all views created by this resolver can be specified via the #setViewClass(Class) property.

Note: When chaining ViewResolvers this resolver will check for the existence of the specified template resources and only return a non-null View object if a template is actually found.