public class

TilesView

extends InternalResourceView
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
           ↳ org.springframework.web.servlet.view.InternalResourceView
             ↳ org.springframework.web.servlet.view.tiles.TilesView
Known Direct Subclasses

This class is deprecated.
as of Spring 3.0

Class Overview

View implementation that retrieves a Tiles definition. The "url" property is interpreted as name of a Tiles definition.

TilesJstlView with JSTL support is a separate class, mainly to avoid JSTL dependencies in this class.

NOTE: This TilesView class supports Tiles 1.x, a.k.a. "Struts Tiles", which comes as part of Struts 1.x. For Tiles 2.x support, check out TilesView.

Depends on a Tiles DefinitionsFactory which must be available in the ServletContext. This factory is typically set up via a TilesConfigurer bean definition in the application context.

Check out ComponentControllerSupport which provides a convenient base class for Spring-aware component controllers, allowing convenient access to the Spring ApplicationContext.

Summary

[Expand]
Inherited Constants
From class org.springframework.web.servlet.view.AbstractView
Fields
public static final String PATH_ATTRIBUTE Name of the attribute that will override the path of the layout page to render.
[Expand]
Inherited Fields
From class org.springframework.context.support.ApplicationObjectSupport
From interface org.springframework.web.servlet.View
Public Constructors
TilesView()
Public Methods
static void setPath(HttpServletRequest request, String path)
Set the path of the layout page to render.
Protected Methods
void executeController(Controller controller, ComponentContext context, HttpServletRequest request, HttpServletResponse response)
Execute the given Tiles controller.
ComponentContext getComponentContext(ComponentDefinition definition, HttpServletRequest request)
Determine the Tiles component context for the given Tiles definition.
ComponentDefinition getComponentDefinition(DefinitionsFactory factory, HttpServletRequest request)
Determine the Tiles component definition for the given Tiles definitions factory.
Controller getController(ComponentDefinition definition, HttpServletRequest request)
Determine and initialize the Tiles component controller for the given Tiles definition, if any.
String getDispatcherPath(ComponentDefinition definition, HttpServletRequest request)
Determine the dispatcher path for the given Tiles definition, i.e.
void initApplicationContext()
Subclasses can override this for custom initialization behavior.
String prepareForRendering(HttpServletRequest request, HttpServletResponse response)
Prepare for rendering the Tiles definition: Execute the associated component controller if any, and determine the request dispatcher path.
[Expand]
Inherited Methods
From class org.springframework.web.servlet.view.InternalResourceView
From class org.springframework.web.servlet.view.AbstractUrlBasedView
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

Fields

public static final String PATH_ATTRIBUTE

Name of the attribute that will override the path of the layout page to render. A Tiles component controller can set such an attribute to dynamically switch the look and feel of a Tiles page.

Public Constructors

public TilesView ()

Public Methods

public static void setPath (HttpServletRequest request, String path)

Set the path of the layout page to render.

Parameters
request current HTTP request
path the path of the layout page
See Also

Protected Methods

protected void executeController (Controller controller, ComponentContext context, HttpServletRequest request, HttpServletResponse response)

Execute the given Tiles controller.

Parameters
controller the component controller to execute
context the component context
request current HTTP request
response current HTTP response
Throws
Exception if controller execution failed

protected ComponentContext getComponentContext (ComponentDefinition definition, HttpServletRequest request)

Determine the Tiles component context for the given Tiles definition.

Parameters
definition the Tiles definition to render
request current HTTP request
Returns
  • the component context
Throws
Exception if preparations failed

protected ComponentDefinition getComponentDefinition (DefinitionsFactory factory, HttpServletRequest request)

Determine the Tiles component definition for the given Tiles definitions factory.

Parameters
factory the Tiles definitions factory
request current HTTP request
Returns
  • the component definition
Throws
Exception

protected Controller getController (ComponentDefinition definition, HttpServletRequest request)

Determine and initialize the Tiles component controller for the given Tiles definition, if any.

Parameters
definition the Tiles definition to render
request current HTTP request
Returns
  • the component controller to execute, or null if none
Throws
Exception if preparations failed

protected String getDispatcherPath (ComponentDefinition definition, HttpServletRequest request)

Determine the dispatcher path for the given Tiles definition, i.e. the request dispatcher path of the layout page.

Parameters
definition the Tiles definition to render
request current HTTP request
Returns
  • the path of the layout page to render
Throws
Exception if preparations failed

protected void initApplicationContext ()

Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by initApplicationContext(org.springframework.context.ApplicationContext).

protected String prepareForRendering (HttpServletRequest request, HttpServletResponse response)

Prepare for rendering the Tiles definition: Execute the associated component controller if any, and determine the request dispatcher path.

Parameters
request current HTTP request
response current HTTP response
Returns
  • the request dispatcher path to use
Throws
Exception