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

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
                      extended by org.springframework.js.ajax.tiles2.AjaxTilesView
                          extended by org.springbyexample.web.servlet.view.tiles2.AjaxDynamicTilesView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
FlowAjaxDynamicTilesView

public class AjaxDynamicTilesView
extends org.springframework.js.ajax.tiles2.AjaxTilesView

If the request isn't an AJAX request, DynamicTilesView will handle the request. Otherwise it is expected that an AJAX view render will be next in the chain and can handle the request.

Note: Most code is copied from AjaxTilesView (giving author credit to original author). If the method flattenedAttributeMap also processed temporary Tiles context attributes, no changes to this class only renderMergedOutputModel would need to be overridden.

Author:
Jeremy Grelle, David Winterfeldt

Field Summary
 
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
 
Constructor Summary
AjaxDynamicTilesView()
           
 
Method Summary
protected  void renderMergedAjaxOutputModel(String definitionName, Map model, HttpServletRequest request, HttpServletResponse response)
          Renders AJAX fragment request.
protected  void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response)
          Renders output using Tiles.
 
Methods inherited from class org.springframework.js.ajax.tiles2.AjaxTilesView
getAjaxHandler, getRenderFragments, setAjaxHandler
 
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, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, 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

AjaxDynamicTilesView

public AjaxDynamicTilesView()
Method Detail

renderMergedOutputModel

protected void renderMergedOutputModel(Map model,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
                                throws Exception
Renders output using Tiles.

Overrides:
renderMergedOutputModel in class org.springframework.js.ajax.tiles2.AjaxTilesView
Throws:
Exception

renderMergedAjaxOutputModel

protected void renderMergedAjaxOutputModel(String definitionName,
                                           Map model,
                                           HttpServletRequest request,
                                           HttpServletResponse response)
                                    throws Exception

Renders AJAX fragment request.

Note: Copied and modified from AjaxTilesView. The way the method is structured, it wasn't able to be reused (as well as flattenedAttributeMap.

Throws:
Exception


Copyright © 2008 Spring by Example. All Rights Reserved.