| org.springframework.web.context.support.WebApplicationObjectSupport org.springframework.web.servlet.view.AbstractCachingViewResolver
All known Subclasses: org.springframework.web.servlet.view.XmlViewResolver, org.springframework.web.servlet.view.UrlBasedViewResolver, org.springframework.web.servlet.view.ResourceBundleViewResolver,
Method Summary | |
public void | clearCache() Clear the entire view cache, removing all cached view objects. | protected View | createView(String viewName, Locale locale) Create the actual View object. | protected Object | getCacheKey(String viewName, Locale locale) Return the cache key for the given view name and the given locale. | public boolean | isCache() Return if caching is enabled. | abstract protected View | loadView(String viewName, Locale locale) Subclasses must implement this method, building a View object
for the specified view. | public void | removeFromCache(String viewName, Locale locale) Provides functionality to clear the cache for a certain view.
This can be handy in case developer are able to modify views
(e.g. | public View | resolveViewName(String viewName, Locale locale) | public void | setCache(boolean cache) Enable or disable caching. |
clearCache | public void clearCache()(Code) | | Clear the entire view cache, removing all cached view objects.
Subsequent resolve calls will lead to recreation of demanded view objects.
|
createView | protected View createView(String viewName, Locale locale) throws Exception(Code) | | Create the actual View object.
The default implementation delegates to
AbstractCachingViewResolver.loadView .
This can be overridden to resolve certain view names in a special fashion,
before delegating to the actual loadView implementation
provided by the subclass.
Parameters: viewName - the name of the view to retrieve Parameters: locale - the Locale to retrieve the view for the View instance, or null if not found(optional, to allow for ViewResolver chaining) throws: Exception - if the view couldn't be resolved See Also: AbstractCachingViewResolver.loadView |
getCacheKey | protected Object getCacheKey(String viewName, Locale locale)(Code) | | Return the cache key for the given view name and the given locale.
Default is a String consisting of view name and locale suffix.
Can be overridden in subclasses.
Needs to respect the locale in general, as a different locale can
lead to a different view resource.
|
isCache | public boolean isCache()(Code) | | Return if caching is enabled.
|
loadView | abstract protected View loadView(String viewName, Locale locale) throws Exception(Code) | | Subclasses must implement this method, building a View object
for the specified view. The returned View objects will be
cached by this ViewResolver base class.
Subclasses are not forced to support internationalization:
A subclass that does not may simply ignore the locale parameter.
Parameters: viewName - the name of the view to retrieve Parameters: locale - the Locale to retrieve the view for the View instance, or null if not found(optional, to allow for ViewResolver chaining) throws: Exception - if the view couldn't be resolved See Also: AbstractCachingViewResolver.resolveViewName |
removeFromCache | public void removeFromCache(String viewName, Locale locale)(Code) | | Provides functionality to clear the cache for a certain view.
This can be handy in case developer are able to modify views
(e.g. Velocity templates) at runtime after which you'd need to
clear the cache for the specified view.
Parameters: viewName - the view name for which the cached view object(if any) needs to be removed Parameters: locale - the locale for which the view object should be removed |
setCache | public void setCache(boolean cache)(Code) | | Enable or disable caching.
Default is "true": caching is enabled.
Disable this only for debugging and development.
Warning: Disabling caching can severely impact performance.
|
|
|