Top Description Fields Constructors Methods
org.springframework.web.reactive.result.view

public abstract Class AbstractUrlBasedView

extends AbstractView
implements InitializingBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.InitializingBean
Known Direct Subclasses
org.springframework.web.reactive.result.view.RedirectView, org.springframework.web.reactive.result.view.freemarker.FreeMarkerView, org.springframework.web.reactive.result.view.script.ScriptTemplateView
Imports
java.util.Locale, reactor.core.publisher.Mono, org.springframework.beans.factory.InitializingBean, org.springframework.lang.Nullable

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

Field Summary

Modifier and TypeField and Description
private String
Inherited from org.springframework.web.reactive.result.view.AbstractView:
loggerREQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME

Constructor Summary

AccessConstructor and Description
protected
AbstractUrlBasedView()

Constructor for use as a bean.

protected
AbstractUrlBasedView(String url)

Create a new AbstractUrlBasedView with the given URL.

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

public abstract boolean

Returns:

false if the resource exists false if we know that it does not exist
checkResourceExists
(Locale
the desired Locale that we're looking for
locale
)

Check whether the resource for the configured URL actually exists.

public String
getUrl()

Return the URL of the resource that this view wraps.

public Mono<Boolean>

Returns:

false if the resource exists false if we know that it does not exist
resourceExists
(Locale
the desired Locale that we're looking for
locale
)

Deferred check whether the resource for the configured URL actually exists.

public void
setUrl(String url)

Set the URL of the resource that this view wraps.

public String
toString()

Overrides org.springframework.web.reactive.result.view.AbstractView.toString.

Returns a string representation of the object.

Inherited from org.springframework.web.reactive.result.view.AbstractView:
createRequestContextformatViewNamegetApplicationContextgetBeanNamegetDefaultCharsetgetModelAttributesgetRequestContextAttributegetRequestDataValueProcessorgetSupportedMediaTypesobtainApplicationContextrenderrenderInternalresolveAsyncAttributessetApplicationContextsetBeanNamesetDefaultCharsetsetRequestContextAttributesetSupportedMediaTypes

Field Detail

urlback to summary
private String url
Annotations
@Nullable

Constructor Detail

AbstractUrlBasedViewback to summary
protected AbstractUrlBasedView()

Constructor for use as a bean.

AbstractUrlBasedViewback to summary
protected AbstractUrlBasedView(String url)

Create a new AbstractUrlBasedView with the given URL.

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet() throws Exception

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

Annotations
@Override
Exceptions
Exception:
in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
checkResourceExistsback to summary
public abstract boolean checkResourceExists(Locale locale) throws Exception

Check whether the resource for the configured URL actually exists.

Parameters
locale:Locale

the desired Locale that we're looking for

Returns:boolean

false if the resource exists false if we know that it does not exist

Exceptions
Exception:
if the resource exists but is invalid (e.g. could not be parsed)
getUrlback to summary
public String getUrl()

Return the URL of the resource that this view wraps.

Annotations
@Nullable
resourceExistsback to summary
public Mono<Boolean> resourceExists(Locale locale)

Deferred check whether the resource for the configured URL actually exists.

The default implementation calls checkResourceExists(Locale).

Parameters
locale:Locale

the desired Locale that we're looking for

Returns:Mono<Boolean>

false if the resource exists false if we know that it does not exist

Since
6.1
setUrlback to summary
public void setUrl(String url)

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

toStringback to summary
public String toString()

Overrides org.springframework.web.reactive.result.view.AbstractView.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override