TilesView (Spring Framework 3.2.1.RELEASE API)
Date: 2013-01-24

org.springframework.web.servlet.view.tiles

## Class TilesView

- 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

- All Implemented Interfaces:
    Aware, BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
  Direct Known Subclasses:
    TilesJstlView

  Deprecated.
  as of Spring 3.0

      @Deprecated
      public class TilesView
      extends InternalResourceView

  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.

  Author:
    Alef Arendsen, Juergen Hoeller
  See Also:
    `AbstractUrlBasedView.setUrl(java.lang.String)`, `TilesJstlView`, `TilesConfigurer`, `ComponentControllerSupport`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PATH_ATTRIBUTE` Deprecated. Name of the attribute that will override the path of the layout page to render.

    - ### Fields inherited from class org.springframework.web.servlet.view.AbstractView

      `DEFAULT_CONTENT_TYPE`

    - ### Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

      `logger`

    - ### Fields inherited from interface org.springframework.web.servlet.View

      `PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TilesView()` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `executeController(org.apache.struts.tiles.Controller controller, org.apache.struts.tiles.ComponentContext context, HttpServletRequest request, HttpServletResponse response)` Deprecated. Execute the given Tiles controller.
    `protected org.apache.struts.tiles.ComponentContext` | `getComponentContext(org.apache.struts.tiles.ComponentDefinition definition, HttpServletRequest request)` Deprecated. Determine the Tiles component context for the given Tiles definition.
    `protected org.apache.struts.tiles.ComponentDefinition` | `getComponentDefinition(org.apache.struts.tiles.DefinitionsFactory factory, HttpServletRequest request)` Deprecated. Determine the Tiles component definition for the given Tiles definitions factory.
    `protected org.apache.struts.tiles.Controller` | `getController(org.apache.struts.tiles.ComponentDefinition definition, HttpServletRequest request)` Deprecated. Determine and initialize the Tiles component controller for the given Tiles definition, if any.
    `protected String` | `getDispatcherPath(org.apache.struts.tiles.ComponentDefinition definition, HttpServletRequest request)` Deprecated. Determine the dispatcher path for the given Tiles definition, i.e.
    `protected void` | `initApplicationContext()` Deprecated. Subclasses can override this for custom initialization behavior.
    `protected String` | `prepareForRendering(HttpServletRequest request, HttpServletResponse response)` Deprecated. Prepare for rendering the Tiles definition: Execute the associated component controller if any, and determine the request dispatcher path.
    `static void` | `setPath(HttpServletRequest request, String path)` Deprecated. Set the path of the layout page to render.

    - ### Methods inherited from class org.springframework.web.servlet.view.InternalResourceView

      `exposeForwardRequestAttributes, exposeHelpers, getRequestDispatcher, getRequestToExpose, initServletContext, isContextRequired, renderMergedOutputModel, setAlwaysInclude, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposeForwardAttributes, setPreventDispatchLoop, useInclude`

    - ### Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView

      `afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString`

    - ### Methods inherited from class org.springframework.web.servlet.view.AbstractView

      `addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponse`

    - ### Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

      `getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, setServletContext`

    - ### Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

      `getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext`

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

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

- - ### Field Detail

    - #### PATH_ATTRIBUTE

          public static final String PATH_ATTRIBUTE

      Deprecated.
      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.
      See Also:
        `setPath(javax.servlet.http.HttpServletRequest, java.lang.String)`

  - ### Constructor Detail

    - #### TilesView

          public TilesView()

      Deprecated.

  - ### Method Detail

    - #### setPath

          public static void setPath(HttpServletRequest request,
                     String path)

      Deprecated.
      Set the path of the layout page to render.
      Parameters:
        `request` - current HTTP request
        `path` - the path of the layout page
      See Also:
        `PATH_ATTRIBUTE`

    - #### initApplicationContext

          protected void initApplicationContext()
                                         throws ApplicationContextException

      Deprecated.
      Description copied from class: `ApplicationObjectSupport`
      Subclasses can override this for custom initialization behavior.

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

      Overrides:
        `initApplicationContext` in class `ApplicationObjectSupport`
      Throws:
        `ApplicationContextException` - in case of initialization errors
      See Also:
        `ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)`

    - #### prepareForRendering

          protected String prepareForRendering(HttpServletRequest request,
                                   HttpServletResponse response)
                                        throws Exception

      Deprecated.
      Prepare for rendering the Tiles definition: Execute the associated component controller if any, and determine the request dispatcher path.
      Overrides:
        `prepareForRendering` in class `InternalResourceView`
      Parameters:
        `request` - current HTTP request
        `response` - current HTTP response
      Returns:
        the request dispatcher path to use
      Throws:
        `Exception` - if preparations failed
      See Also:
        `AbstractUrlBasedView.getUrl()`

    - #### getComponentDefinition

          protected org.apache.struts.tiles.ComponentDefinition getComponentDefinition(org.apache.struts.tiles.DefinitionsFactory factory,
                                                                           HttpServletRequest request)
                                                                                throws Exception

      Deprecated.
      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`

    - #### getComponentContext

          protected org.apache.struts.tiles.ComponentContext getComponentContext(org.apache.struts.tiles.ComponentDefinition definition,
                                                                     HttpServletRequest request)
                                                                          throws Exception

      Deprecated.
      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

    - #### getController

          protected org.apache.struts.tiles.Controller getController(org.apache.struts.tiles.ComponentDefinition definition,
                                                         HttpServletRequest request)
                                                              throws Exception

      Deprecated.
      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

    - #### executeController

          protected void executeController(org.apache.struts.tiles.Controller controller,
                               org.apache.struts.tiles.ComponentContext context,
                               HttpServletRequest request,
                               HttpServletResponse response)
                                    throws Exception

      Deprecated.
      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

    - #### getDispatcherPath

          protected String getDispatcherPath(org.apache.struts.tiles.ComponentDefinition definition,
                                 HttpServletRequest request)
                                      throws Exception

      Deprecated.
      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