Class GroovyMarkupViewResolver
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
org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver
- All Implemented Interfaces:
Aware
,ApplicationContextAware
,Ordered
,ServletContextAware
,ViewResolver
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 UrlBasedViewResolver.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.
- Since:
- 4.1
- Author:
- Brian Clozel
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
AbstractCachingViewResolver.CacheFilter
-
Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
DEFAULT_CACHE_LIMIT
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
getCacheKey
(String viewName, Locale locale) This resolver supports i18n, so cache keys should contain the locale.protected AbstractUrlBasedView
Instantiate the specified view class.protected Class<?>
Return the required type of view for this resolver.Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateViewResolver
buildView, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
applyLifecycleMethods, canHandle, createView, getAttributesMap, getContentType, getExposeContextBeansAsAttributes, getExposedContextBeanNames, getExposePathVariables, getOrder, getPrefix, getRedirectHosts, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHosts, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, getCacheFilter, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCache, setCacheFilter, setCacheLimit, setCacheUnresolved
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Constructor Details
-
GroovyMarkupViewResolver
public GroovyMarkupViewResolver() -
GroovyMarkupViewResolver
A convenience constructor that allows for specifying theprefix
andsuffix
as constructor arguments.- Parameters:
prefix
- the prefix that gets prepended to view names when building a URLsuffix
- the suffix that gets appended to view names when building a URL- Since:
- 4.3
-
-
Method Details
-
requiredViewClass
Description copied from class:UrlBasedViewResolver
Return the required type of view for this resolver. This implementation returnsAbstractUrlBasedView
.- Overrides:
requiredViewClass
in classAbstractTemplateViewResolver
- See Also:
-
instantiateView
Description copied from class:UrlBasedViewResolver
Instantiate the specified view class.The default implementation uses reflection to instantiate the class.
- Overrides:
instantiateView
in classUrlBasedViewResolver
- Returns:
- a new instance of the view class
- See Also:
-
getCacheKey
This resolver supports i18n, so cache keys should contain the locale.- Overrides:
getCacheKey
in classUrlBasedViewResolver
-