org.springbyexample.web.servlet.view.tiles2
Class DynamicTilesViewProcessor

java.lang.Object
  extended by org.springbyexample.web.servlet.view.tiles2.DynamicTilesViewProcessor

public class DynamicTilesViewProcessor
extends Object

Used for rendering and processing a dynamic tiles view.

Author:
David Winterfeldt

Constructor Summary
DynamicTilesViewProcessor()
           
 
Method Summary
protected  void endDynamicDefinition(String definitionName, String beanName, HttpServletRequest request, HttpServletResponse response, org.apache.tiles.TilesContainer container)
          Closes the temporary Tiles definition.
protected  String processTilesDefinitionName(String beanName, org.apache.tiles.TilesContainer container, HttpServletRequest request, HttpServletResponse response)
          Processes values to get tiles template definition name.
protected  void renderMergedOutputModel(String beanName, String url, ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, org.apache.tiles.TilesContainer container)
          Renders output using Tiles.
 void setTilesBodyAttributeName(String tilesBodyAttributeName)
          Tiles body attribute name.
 void setTilesDefinitionDelimiter(String tilesDefinitionDelimiter)
          Sets Tiles definition delimiter.
 void setTilesDefinitionName(String tilesDefinitionName)
          Main template name.
protected  String startDynamicDefinition(String beanName, String url, HttpServletRequest request, HttpServletResponse response, org.apache.tiles.TilesContainer container)
          Starts processing the dynamic Tiles definition by creating a temporary definition for rendering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicTilesViewProcessor

public DynamicTilesViewProcessor()
Method Detail

setTilesDefinitionName

public void setTilesDefinitionName(String tilesDefinitionName)
Main template name. The default is 'mainTemplate'.

Parameters:
tilesDefinitionName - Main template name used to lookup definitions.

setTilesBodyAttributeName

public void setTilesBodyAttributeName(String tilesBodyAttributeName)
Tiles body attribute name. The default is 'body'.

Parameters:
tilesBodyAttributeName - Tiles body attribute name.

setTilesDefinitionDelimiter

public void setTilesDefinitionDelimiter(String tilesDefinitionDelimiter)
Sets Tiles definition delimiter. For example, instead of using the request 'info/about' to lookup the template definition 'info/mainTemplate', the default delimiter of '.' would look for '.info.mainTemplate'

Parameters:
tilesDefinitionDelimiter - Optional delimiter to replace '/' in a url.

renderMergedOutputModel

protected void renderMergedOutputModel(String beanName,
                                       String url,
                                       ServletContext servletContext,
                                       HttpServletRequest request,
                                       HttpServletResponse response,
                                       org.apache.tiles.TilesContainer container)
                                throws Exception
Renders output using Tiles.

Throws:
Exception

startDynamicDefinition

protected String startDynamicDefinition(String beanName,
                                        String url,
                                        HttpServletRequest request,
                                        HttpServletResponse response,
                                        org.apache.tiles.TilesContainer container)
                                 throws org.apache.tiles.TilesException
Starts processing the dynamic Tiles definition by creating a temporary definition for rendering.

Throws:
org.apache.tiles.TilesException

endDynamicDefinition

protected void endDynamicDefinition(String definitionName,
                                    String beanName,
                                    HttpServletRequest request,
                                    HttpServletResponse response,
                                    org.apache.tiles.TilesContainer container)
Closes the temporary Tiles definition.


processTilesDefinitionName

protected String processTilesDefinitionName(String beanName,
                                            org.apache.tiles.TilesContainer container,
                                            HttpServletRequest request,
                                            HttpServletResponse response)
                                     throws org.apache.tiles.TilesException
Processes values to get tiles template definition name. First a Tiles definition matching the url is checked, then a url specific template is checked, and then just the default root definition is used.

Throws:
org.apache.tiles.TilesException - If no valid Tiles definition is found.


Copyright © 2008 Spring by Example. All Rights Reserved.