spring-framework / org.springframework.web.reactive.result.view / AbstractUrlBasedView

AbstractUrlBasedView

abstract class AbstractUrlBasedView : AbstractView, InitializingBean

Abstract base class for URL-based views. Provides a consistent way of holding the URL that a View wraps, in the form of a "url" bean property.

Author
Rossen Stoyanchev

Since
5.0

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

checkResourceExists

abstract fun checkResourceExists(locale: Locale): Boolean

Check whether the resource for the configured URL actually exists.

getUrl

open fun getUrl(): String

Return the URL of the resource that this view wraps.

setUrl

open fun setUrl(url: String): Unit

Set the URL of the resource that this view wraps. The URL must be appropriate for the concrete View implementation.

toString

open fun toString(): String

Inheritors

FreeMarkerView

open class FreeMarkerView : AbstractUrlBasedView

A View implementation that uses the FreeMarker template engine.

Depends on a single FreeMarkerConfig object such as FreeMarkerConfigurer being accessible in the application context. Alternatively set the FreeMarker configuration can be set directly on this class via #setConfiguration.

The url property is the location of the FreeMarker template relative to the FreeMarkerConfigurer's templateLoaderPath.

Note: Spring's FreeMarker support requires FreeMarker 2.3 or higher.

ScriptTemplateView

open class ScriptTemplateView : AbstractUrlBasedView

An AbstractUrlBasedView subclass designed to run any template library based on a JSR-223 script engine.

If not set, each property is auto-detected by looking up a single ScriptTemplateConfig bean in the web application context and using it to obtain the configured properties.

The Nashorn JavaScript engine requires Java 8+ and may require setting the sharedEngine property to false in order to run properly. See ScriptTemplateConfigurer#setSharedEngine(Boolean) for more details.