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
 
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
 
Constructor Summary
AjaxDynamicTilesView()
           
 
Method Summary
 boolean checkResource(Locale locale)
          Check whether the underlying resource that the configured URL points to actually exists.
protected  void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response)
          Renders output using Tiles.
 
Methods inherited from class org.springframework.js.ajax.tiles2.AjaxTilesView
flattenAttributeMap, 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

checkResource

public boolean checkResource(Locale locale)
                      throws Exception
Check whether the underlying resource that the configured URL points to actually exists.

Overrides:
checkResource in class TilesView
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)


Copyright © 2008-2009 Spring by Example. All Rights Reserved.