public abstract class

AbstractUrlBasedView

extends AbstractView
implements InitializingBean
java.lang.Object
   ↳ org.springframework.context.support.ApplicationObjectSupport
     ↳ org.springframework.web.context.support.WebApplicationObjectSupport
       ↳ org.springframework.web.servlet.view.AbstractView
         ↳ org.springframework.web.servlet.view.AbstractUrlBasedView
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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.

Summary

[Expand]
Inherited Constants
From class org.springframework.web.servlet.view.AbstractView
[Expand]
Inherited Fields
From class org.springframework.context.support.ApplicationObjectSupport
From interface org.springframework.web.servlet.View
Protected Constructors
AbstractUrlBasedView()
Constructor for use as a bean.
AbstractUrlBasedView(String url)
Create a new AbstractUrlBasedView with the given URL.
Public Methods
void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
boolean checkResource(Locale locale)
Check whether the underlying resource that the configured URL points to 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()
Protected Methods
boolean isUrlRequired()
Return whether the 'url' property is required.
[Expand]
Inherited Methods
From class org.springframework.web.servlet.view.AbstractView
From class org.springframework.web.context.support.WebApplicationObjectSupport
From class org.springframework.context.support.ApplicationObjectSupport
From class java.lang.Object
From interface org.springframework.beans.factory.BeanNameAware
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.context.ApplicationContextAware
From interface org.springframework.web.context.ServletContextAware
From interface org.springframework.web.servlet.View

Protected Constructors

protected AbstractUrlBasedView ()

Constructor for use as a bean.

protected AbstractUrlBasedView (String url)

Create a new AbstractUrlBasedView with the given URL.

Parameters
url the URL to forward to

Public Methods

public void afterPropertiesSet ()

Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Throws
Exception

public boolean checkResource (Locale locale)

Check whether the underlying resource that the configured URL points to actually exists.

Parameters
locale the desired Locale that we're looking for
Returns
  • true if the resource exists (or is assumed to exist); false if we know that it does not exist
Throws
Exception if the resource exists but is invalid (e.g. could not be parsed)

public String getUrl ()

Return the URL of the resource that this view wraps.

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.

public String toString ()

Protected Methods

protected boolean isUrlRequired ()

Return whether the 'url' property is required.

The default implementation returns true