The Spring Framework

org.springframework.web.servlet.view.tiles2
Class TilesView

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.view.AbstractView
              extended by org.springframework.web.servlet.view.AbstractUrlBasedView
                  extended by org.springframework.web.servlet.view.tiles2.TilesView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View

public class TilesView
extends AbstractUrlBasedView

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

This class builds on Tiles2, which requires Java 5 and JSP 2.0. JSTL support is integrated out of the box.

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

Author:
Juergen Hoeller
See Also:
AbstractUrlBasedView.setUrl(java.lang.String), TilesConfigurer

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
 
Constructor Summary
TilesView()
           
 
Method Summary
protected  void initApplicationContext()
          Subclasses can override this for custom initialization behavior.
protected  void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response)
          Subclasses must implement this method to actually render the view.
 
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, getUrl, isUrlRequired, setUrl, toString
 
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired, 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
 

Constructor Detail

TilesView

public TilesView()
Method Detail

initApplicationContext

protected void initApplicationContext()
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior. Gets called by setApplicationContext after setting the context instance.

Note: Does not get called on reinitialization of the context but rather just on first initialization of this object's context reference.

Overrides:
initApplicationContext in class ApplicationObjectSupport
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

renderMergedOutputModel

protected void renderMergedOutputModel(Map 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

The Spring Framework

Copyright © 2002-2007 The Spring Framework.