spring-framework / org.springframework.web.servlet.view.freemarker / FreeMarkerViewResolver

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.

Author
Juergen Hoeller

Since
1.1

See Also
#setViewClass#setPrefix#setSuffix#setRequestContextAttribute#setExposeSpringMacroHelpersFreeMarkerView

Constructors

<init>

FreeMarkerViewResolver()

Sets the default view class to #requiredViewClass: by default FreeMarkerView.

FreeMarkerViewResolver(prefix: String, suffix: String)

A convenience constructor that allows for specifying prefix and suffix as constructor arguments.

Inherited 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".