org.springframework.web.servlet.view.tiles3

## 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.tiles3.TilesView

- All Implemented Interfaces:
    Aware, BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View

      public class TilesView
      extends AbstractUrlBasedView

  `View` implementation that renders through the Tiles Request API. The "url" property is interpreted as name of a Tiles definition.
  Since:
    3.2
  Author:
    Nicolas Le Bas, mick semb wever, Rossen Stoyanchev

- - ### Field Summary

    - ### 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()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `protected Request` | `createTilesRequest(HttpServletRequest request, HttpServletResponse response)` Create a Tiles `Request`.
    `protected void` | `renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)` Subclasses must implement this method to actually render the view.
    `protected void` | `setExposeJstlAttributes(boolean exposeJstlAttributes)` Whether to expose JSTL attributes.
    `void` | `setRenderer(Renderer renderer)` Set the `Renderer` to use.

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

      `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, initServletContext, isContextRequired, setServletContext`

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

      `getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext`

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

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

- - ### Constructor Detail

    - #### TilesView

          public TilesView()

  - ### Method Detail

    - #### setRenderer

          public void setRenderer(Renderer renderer)

      Set the `Renderer` to use. If not set, by default `DefinitionRenderer` is used.

    - #### setExposeJstlAttributes

          protected void setExposeJstlAttributes(boolean exposeJstlAttributes)

      Whether to expose JSTL attributes. By default set to `true`.
      See Also:
        `JstlUtils.exposeLocalizationContext(RequestContext)`

    - #### afterPropertiesSet

          public void afterPropertiesSet()
                                  throws Exception

      Description copied from interface: `InitializingBean`
      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.

      Specified by:
        `afterPropertiesSet` in interface `InitializingBean`
      Overrides:
        `afterPropertiesSet` in class `AbstractUrlBasedView`
      Throws:
        `Exception` - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

    - #### checkResource

          public boolean checkResource(Locale locale)
                                throws Exception

      Description copied from class: `AbstractUrlBasedView`
      Check whether the underlying resource that the configured URL points to actually exists.
      Overrides:
        `checkResource` in class `AbstractUrlBasedView`
      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)

    - #### renderMergedOutputModel

          protected void renderMergedOutputModel(Map<String,Object> model,
                                                 HttpServletRequest request,
                                                 HttpServletResponse response)
                                          throws Exception

      Description copied from class: `AbstractView`
      Subclasses must implement this method to actually render the view.

      The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

      Specified by:
        `renderMergedOutputModel` in class `AbstractView`
      Parameters:
        `model` - combined output Map (never `null`), with dynamic values taking precedence over static attributes
        `request` - current HTTP request
        `response` - current HTTP response
      Throws:
        `Exception` - if rendering failed

    - #### createTilesRequest

          protected Request createTilesRequest(HttpServletRequest request,
                                               HttpServletResponse response)

      Create a Tiles `Request`.

      This implementation creates a `ServletRequest`.

      Parameters:
        `request` - the current request
        `response` - the current response
      Returns:
        the Tiles request