org.springframework.web.reactive.result.view

## Class AbstractUrlBasedView

- java.lang.Object
- - org.springframework.web.reactive.result.view.AbstractView
  - - org.springframework.web.reactive.result.view.AbstractUrlBasedView

All Implemented Interfaces:
  org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, View

Direct Known Subclasses:
  FreeMarkerView, RedirectView, ScriptTemplateView

    public abstract class AbstractUrlBasedView
    extends AbstractView
    implements org.springframework.beans.factory.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.

Since:
  5.0
Author:
  Rossen Stoyanchev

### Field Summary

### Fields inherited from class org.springframework.web.reactive.result.view.AbstractView

`logger, REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME`

### Fields inherited from interface org.springframework.web.reactive.result.view.View

`BINDING_CONTEXT_ATTRIBUTE`

### Constructor Summary

Constructors
`protected` `AbstractUrlBasedView()` Constructor for use as a bean.
`protected` `AbstractUrlBasedView(String url)` Create a new AbstractUrlBasedView with the given URL.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`void` `afterPropertiesSet()`
`abstract boolean` `checkResourceExists(Locale locale)` Check whether the resource for the configured URL actually exists.
`String` `getUrl()` Return the URL of the resource that this view wraps.
`void` `setUrl(String url)` Set the URL of the resource that this view wraps.
`String` `toString()`

### Methods inherited from class org.springframework.web.reactive.result.view.AbstractView

`createRequestContext, formatViewName, getApplicationContext, getBeanName, getDefaultCharset, getModelAttributes, getRequestContextAttribute, getRequestDataValueProcessor, getSupportedMediaTypes, obtainApplicationContext, render, renderInternal, resolveAsyncAttributes, resolveAsyncAttributes, setApplicationContext, setBeanName, setDefaultCharset, setRequestContextAttribute, setSupportedMediaTypes`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.web.reactive.result.view.View

`isRedirectView`

### Constructor Detail

#### AbstractUrlBasedView

    protected AbstractUrlBasedView()

Constructor for use as a bean.

#### AbstractUrlBasedView

    protected AbstractUrlBasedView(String url)

Create a new AbstractUrlBasedView with the given URL.

### Method Detail

#### setUrl

    public void setUrl(@Nullable
                       String url)

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

#### getUrl

    @Nullable
    public String getUrl()

Return the URL of the resource that this view wraps.

#### afterPropertiesSet

    public void afterPropertiesSet()
                            throws Exception

Specified by:
  `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
Throws:
  `Exception`

#### checkResourceExists

    public abstract boolean checkResourceExists(Locale locale)
                                         throws Exception

Check whether the resource for the configured URL actually exists.

Parameters:
  `locale` - the desired Locale that we're looking for
Returns:
  `false` if the resource exists `false` if we know that it does not exist
Throws:
  `Exception` - if the resource exists but is invalid (e.g. could not be parsed)

#### toString

    public String toString()

Overrides:
  `toString` in class `AbstractView`