spring-framework / org.springframework.web.servlet.config.annotation / UrlBasedViewResolverRegistration

UrlBasedViewResolverRegistration

open class UrlBasedViewResolverRegistration

Assist with configuring a org.springframework.web.servlet.view.UrlBasedViewResolver.

Author
Sebastien Deleuze

Author
Rossen Stoyanchev

Since
4.1

Constructors

<init>

UrlBasedViewResolverRegistration(viewResolver: UrlBasedViewResolver)

Functions

attributes

open fun attributes(attributes: MutableMap<String, *>): UrlBasedViewResolverRegistration

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.

cache

open fun cache(cache: Boolean): UrlBasedViewResolverRegistration

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.

cacheLimit

open fun cacheLimit(cacheLimit: Int): UrlBasedViewResolverRegistration

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

prefix

open fun prefix(prefix: String): UrlBasedViewResolverRegistration

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

suffix

open fun suffix(suffix: String): UrlBasedViewResolverRegistration

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

viewClass

open fun viewClass(viewClass: Class<*>): UrlBasedViewResolverRegistration

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

viewNames

open fun viewNames(vararg viewNames: String): UrlBasedViewResolverRegistration

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'.