Class UrlBasedViewResolverRegistration
- java.lang.Object
- org.springframework.web.servlet.config.annotation.UrlBasedViewResolverRegistration
public class UrlBasedViewResolverRegistration extends Object
Assist with configuring aUrlBasedViewResolver
.- Since:
- 4.1
- Author:
- Sebastien Deleuze, Rossen Stoyanchev
Field Summary
Fields Modifier and Type Field Description protected UrlBasedViewResolver
viewResolver
Constructor Summary
Constructors Constructor Description UrlBasedViewResolverRegistration(UrlBasedViewResolver viewResolver)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UrlBasedViewResolverRegistration
attributes(Map<String,?> attributes)
Set static attributes to be added to the model of every request for all views resolved by this view resolver.UrlBasedViewResolverRegistration
cache(boolean cache)
Enable or disable caching.UrlBasedViewResolverRegistration
cacheLimit(int cacheLimit)
Specify the maximum number of entries for the view cache.protected UrlBasedViewResolver
getViewResolver()
UrlBasedViewResolverRegistration
prefix(String prefix)
Set the prefix that gets prepended to view names when building a URL.UrlBasedViewResolverRegistration
suffix(String suffix)
Set the suffix that gets appended to view names when building a URL.UrlBasedViewResolverRegistration
viewClass(Class<?> viewClass)
Set the view class that should be used to create views.UrlBasedViewResolverRegistration
viewNames(String... viewNames)
Set the view names (or name patterns) that can be handled by this view resolver.
Field Detail
viewResolver
protected final UrlBasedViewResolver viewResolver
Constructor Detail
UrlBasedViewResolverRegistration
public UrlBasedViewResolverRegistration(UrlBasedViewResolver viewResolver)
Method Detail
getViewResolver
protected UrlBasedViewResolver getViewResolver()
prefix
public UrlBasedViewResolverRegistration prefix(String prefix)
Set the prefix that gets prepended to view names when building a URL.
suffix
public UrlBasedViewResolverRegistration suffix(String suffix)
Set the suffix that gets appended to view names when building a URL.
viewClass
public UrlBasedViewResolverRegistration viewClass(Class<?> viewClass)
Set the view class that should be used to create views.
viewNames
public UrlBasedViewResolverRegistration viewNames(String... viewNames)
Set the view names (or name patterns) that can be handled by this view resolver. View names can contain simple wildcards such that 'my*', '*Report' and '*Repo*' will all match the view name 'myReport'.
attributes
public UrlBasedViewResolverRegistration attributes(Map<String,?> attributes)
Set static attributes to be added to the model of every request for all views resolved by this view resolver. This allows for setting any kind of attribute values, for example bean references.
cacheLimit
public UrlBasedViewResolverRegistration cacheLimit(int cacheLimit)
Specify the maximum number of entries for the view cache. Default is 1024.
cache
public UrlBasedViewResolverRegistration cache(boolean cache)
Enable or disable caching.This is equivalent to setting the
"cacheLimit"
property to the default limit (1024) or to 0, respectively.Default is "true": caching is enabled. Disable this only for debugging and development.