Top Description Constructors Methods
org.springframework.web.servlet.view.groovy

public Class GroovyMarkupViewResolver

extends AbstractTemplateViewResolver
Class Inheritance
Imports
java.util.Locale, org.springframework.web.servlet.view.AbstractTemplateViewResolver, .AbstractUrlBasedView

Convenience subclass of 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 setViewClass(Class).

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.

Author
Brian Clozel
Since
4.1
See Also
GroovyMarkupConfigurer

Constructor Summary

AccessConstructor and Description
public
public
GroovyMarkupViewResolver(String
the prefix that gets prepended to view names when building a URL
prefix
,
String
the suffix that gets appended to view names when building a URL
suffix
)

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

Method Summary

Modifier and TypeMethod and Description
protected Object
getCacheKey(String viewName, Locale locale)

Overrides org.springframework.web.servlet.view.UrlBasedViewResolver.getCacheKey.

This resolver supports i18n, so cache keys should contain the locale.

protected AbstractUrlBasedView
protected Class<?>
Inherited from org.springframework.web.servlet.view.AbstractTemplateViewResolver:
buildViewsetAllowRequestOverridesetAllowSessionOverridesetExposeRequestAttributessetExposeSessionAttributessetExposeSpringMacroHelpers

Constructor Detail

GroovyMarkupViewResolverback to summary
public GroovyMarkupViewResolver()

Sets the default view class to requiredViewClass: by default GroovyMarkupView.

GroovyMarkupViewResolverback to summary
public GroovyMarkupViewResolver(String prefix, String suffix)

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

Parameters
prefix:String

the prefix that gets prepended to view names when building a URL

suffix:String

the suffix that gets appended to view names when building a URL

Since
4.3

Method Detail

getCacheKeyback to summary
protected Object getCacheKey(String viewName, Locale locale)

Overrides org.springframework.web.servlet.view.UrlBasedViewResolver.getCacheKey.

This resolver supports i18n, so cache keys should contain the locale.

Annotations
@Override
instantiateViewback to summary
protected AbstractUrlBasedView instantiateView()

Overrides org.springframework.web.servlet.view.UrlBasedViewResolver.instantiateView.

Doc from org.springframework.web.servlet.view.UrlBasedViewResolver.instantiateView.

Instantiate the specified view class.

The default implementation uses reflection to instantiate the class.

Returns:AbstractUrlBasedView

a new instance of the view class

Annotations
@Override
requiredViewClassback to summary
protected Class<?> requiredViewClass()

Overrides org.springframework.web.servlet.view.AbstractTemplateViewResolver.requiredViewClass.

Doc from org.springframework.web.servlet.view.UrlBasedViewResolver.requiredViewClass.

Return the required type of view for this resolver. This implementation returns AbstractUrlBasedView.

Annotations
@Override