public class ScriptTemplateViewResolver extends UrlBasedViewResolver
UrlBasedViewResolver
that supports
ScriptTemplateView
and custom subclasses of it.
The view class for all views created by this resolver can be specified
via the UrlBasedViewResolver.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.
ScriptTemplateConfigurer
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
DEFAULT_CACHE_LIMIT
logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
ScriptTemplateViewResolver()
|
ScriptTemplateViewResolver(java.lang.String prefix,
java.lang.String suffix)
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Class<?> |
requiredViewClass()
Return the required type of view for this resolver.
|
View |
resolveViewName(java.lang.String viewName,
java.util.Locale locale)
Resolve the given view by name.
|
buildView, canHandle, createView, getAttributesMap, getCacheKey, 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
clearCache, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, setCache, setCacheLimit, setCacheUnresolved
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
public ScriptTemplateViewResolver()
public ScriptTemplateViewResolver(java.lang.String prefix, java.lang.String suffix)
prefix
- the prefix that gets prepended to view names when building a URLsuffix
- the suffix that gets appended to view names when building a URLpublic View resolveViewName(java.lang.String viewName, java.util.Locale locale) throws java.lang.Exception
ViewResolver
Note: To allow for ViewResolver chaining, a ViewResolver should
return null
if a view with the given name is not defined in it.
However, this is not required: Some ViewResolvers will always attempt
to build View objects with the given name, unable to return null
(rather throwing an exception when View creation failed).
resolveViewName
in interface ViewResolver
resolveViewName
in class AbstractCachingViewResolver
viewName
- name of the view to resolvelocale
- Locale in which to resolve the view.
ViewResolvers that support internationalization should respect this.null
if not found
(optional, to allow for ViewResolver chaining)java.lang.Exception
- if the view cannot be resolved
(typically in case of problems creating an actual View object)protected java.lang.Class<?> requiredViewClass()
UrlBasedViewResolver
requiredViewClass
in class UrlBasedViewResolver
AbstractUrlBasedView