org.springframework.batch.admin.web.freemarker
Class AjaxFreeMarkerView

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.AbstractTemplateView
                      extended by org.springframework.web.servlet.view.freemarker.FreeMarkerView
                          extended by org.springframework.batch.admin.web.freemarker.AjaxFreeMarkerView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View

public class AjaxFreeMarkerView
extends FreeMarkerView

Tiles view implementation that is able to handle partial rendering for Spring Javascript Ajax requests.

This implementation uses the SpringJavascriptAjaxHandler by default to determine whether the current request is an Ajax request. On an Ajax request, a "fragments" parameter will be extracted from the request in order to determine which attributes to render from the current view.

Author:
Dave Syer

Field Summary
 
Fields inherited from class org.springframework.web.servlet.view.AbstractTemplateView
SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
 
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
RESPONSE_STATUS_ATTRIBUTE
 
Constructor Summary
AjaxFreeMarkerView()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  String[] getRenderFragments(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)
           
protected  boolean isAjaxRequest(HttpServletRequest request, HttpServletResponse response)
           
protected  void renderMergedTemplateModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)
           
 void setViewResolver(ViewResolver viewResolver)
           
 
Methods inherited from class org.springframework.web.servlet.view.freemarker.FreeMarkerView
autodetectConfiguration, buildTemplateModel, checkResource, doRender, exposeHelpers, getConfiguration, getEncoding, getObjectWrapper, getTemplate, getTemplate, initServletContext, processTemplate, setConfiguration, setEncoding
 
Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateView
applyContentType, renderMergedOutputModel, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
 
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, 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, 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

AjaxFreeMarkerView

public AjaxFreeMarkerView()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractUrlBasedView
Throws:
Exception

setViewResolver

public void setViewResolver(ViewResolver viewResolver)

renderMergedTemplateModel

protected void renderMergedTemplateModel(Map<String,Object> model,
                                         HttpServletRequest request,
                                         HttpServletResponse response)
                                  throws Exception
Overrides:
renderMergedTemplateModel in class FreeMarkerView
Throws:
Exception

isAjaxRequest

protected boolean isAjaxRequest(HttpServletRequest request,
                                HttpServletResponse response)

getRenderFragments

protected String[] getRenderFragments(Map<String,Object> model,
                                      HttpServletRequest request,
                                      HttpServletResponse response)


Copyright © 2011. All Rights Reserved.