类 UrlBasedViewResolverRegistration
- java.lang.Object
- org.springframework.web.servlet.config.annotation.UrlBasedViewResolverRegistration
public class UrlBasedViewResolverRegistration extends Object
Assist with configuring aUrlBasedViewResolver
.- 从以下版本开始:
- 4.1
- 作者:
- Sebastien Deleuze, Rossen Stoyanchev
字段概要
字段 修饰符和类型 字段 说明 protected UrlBasedViewResolver
viewResolver
构造器概要
构造器 构造器 说明 UrlBasedViewResolverRegistration(UrlBasedViewResolver viewResolver)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.
字段详细资料
viewResolver
protected final UrlBasedViewResolver viewResolver
构造器详细资料
UrlBasedViewResolverRegistration
public UrlBasedViewResolverRegistration(UrlBasedViewResolver viewResolver)
方法详细资料
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.