Top Description Fields Constructors Methods
org.springframework.web.servlet.config.annotation

public Class UrlBasedViewResolverRegistration

extends Object
Class Inheritance
Known Direct Subclasses
org.springframework.web.servlet.config.annotation.ViewResolverRegistry.FreeMarkerRegistration, org.springframework.web.servlet.config.annotation.ViewResolverRegistry.GroovyMarkupRegistration, org.springframework.web.servlet.config.annotation.ViewResolverRegistry.ScriptRegistration
Imports
java.util.Map, org.springframework.web.servlet.view.UrlBasedViewResolver

Assist with configuring a org.springframework.web.servlet.view.UrlBasedViewResolver.
Authors
Sebastien Deleuze, Rossen Stoyanchev
Since
4.1

Field Summary

Modifier and TypeField and Description
protected final UrlBasedViewResolver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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.

public UrlBasedViewResolverRegistration
cache(boolean cache)

Enable or disable caching.

public UrlBasedViewResolverRegistration
cacheLimit(int cacheLimit)

Specify the maximum number of entries for the view cache.

protected UrlBasedViewResolver
public UrlBasedViewResolverRegistration
prefix(String prefix)

Set the prefix that gets prepended to view names when building a URL.

public UrlBasedViewResolverRegistration
suffix(String suffix)

Set the suffix that gets appended to view names when building a URL.

public UrlBasedViewResolverRegistration
viewClass(Class<?> viewClass)

Set the view class that should be used to create views.

public UrlBasedViewResolverRegistration
viewNames(String... viewNames)

Set the view names (or name patterns) that can be handled by this view resolver.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

viewResolverback to summary
protected final UrlBasedViewResolver viewResolver

Constructor Detail

UrlBasedViewResolverRegistrationback to summary
public UrlBasedViewResolverRegistration(UrlBasedViewResolver viewResolver)

Method Detail

attributesback to summary
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.

See Also
org.springframework.web.servlet.view.UrlBasedViewResolver#setAttributesMap
cacheback to summary
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.

See Also
org.springframework.web.servlet.view.UrlBasedViewResolver#setCache(boolean)
cacheLimitback to summary
public UrlBasedViewResolverRegistration cacheLimit(int cacheLimit)

Specify the maximum number of entries for the view cache. Default is 1024.

See Also
org.springframework.web.servlet.view.UrlBasedViewResolver#setCache(boolean)
getViewResolverback to summary
protected UrlBasedViewResolver getViewResolver()
prefixback to summary
public UrlBasedViewResolverRegistration prefix(String prefix)

Set the prefix that gets prepended to view names when building a URL.

See Also
org.springframework.web.servlet.view.UrlBasedViewResolver#setPrefix
suffixback to summary
public UrlBasedViewResolverRegistration suffix(String suffix)

Set the suffix that gets appended to view names when building a URL.

See Also
org.springframework.web.servlet.view.UrlBasedViewResolver#setSuffix
viewClassback to summary
public UrlBasedViewResolverRegistration viewClass(Class<?> viewClass)

Set the view class that should be used to create views.

See Also
org.springframework.web.servlet.view.UrlBasedViewResolver#setViewClass
viewNamesback to summary
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'.

See Also
org.springframework.web.servlet.view.UrlBasedViewResolver#setViewNames