org.thymeleaf.spring3.view
Class AjaxThymeleafView

Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.thymeleaf.spring3.view.AbstractThymeleafView
              extended by org.thymeleaf.spring3.view.ThymeleafView
                  extended by org.thymeleaf.spring3.view.AjaxThymeleafView
All Implemented Interfaces:
org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.View
Direct Known Subclasses:
FlowAjaxThymeleafView

public class AjaxThymeleafView
extends ThymeleafView

Subclass of ThymeleafView adding compatibility with AJAX events in Spring JavaScript (part of Spring WebFlow). This allows this View implementation to be able to return only fragments of the page.

These rendering of fragments is used, for example, in Spring WebFlow's <render> instructions (though not only).

This view searches for a comma-separated list of fragment names in a request parameter called fragments, and for each of them:

Since:
2.0.11
Author:
Daniel Fernández

Field Summary
 
Fields inherited from class org.thymeleaf.spring3.view.AbstractThymeleafView
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
AjaxThymeleafView()
           
 
Method Summary
 org.springframework.js.ajax.AjaxHandler getAjaxHandler()
           Return the AJAX handler (from Spring Javascript) used to determine whether a request is an AJAX request or not.
protected  String[] getRenderFragments(Map model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void render(Map<String,?> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void setAjaxHandler(org.springframework.js.ajax.AjaxHandler ajaxHandler)
           Sets the AJAX handler (from Spring Javascript) used to determine whether a request is an AJAX request or not.
 
Methods inherited from class org.thymeleaf.spring3.view.ThymeleafView
getFragmentSpec, renderFragment, setFragmentSpec
 
Methods inherited from class org.thymeleaf.spring3.view.AbstractThymeleafView
addRequestContextAsVariable, addStaticVariable, getBeanName, getCharacterEncoding, getContentType, getLocale, getStaticVariables, getTemplateEngine, getTemplateName, isContentTypeSet, setBeanName, setCharacterEncoding, setContentType, setLocale, setStaticVariables, setTemplateEngine, setTemplateName
 
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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AjaxThymeleafView

public AjaxThymeleafView()
Method Detail

getAjaxHandler

public org.springframework.js.ajax.AjaxHandler getAjaxHandler()

Return the AJAX handler (from Spring Javascript) used to determine whether a request is an AJAX request or not.

This view class should be used with an instance of AjaxThymeleafViewResolver or any of its subclasses, so that setAjaxHandler(AjaxHandler) can be called by the resolver when resolving the view, setting the default AJAX handler being used.

Returns:
the AJAX handler.

setAjaxHandler

public void setAjaxHandler(org.springframework.js.ajax.AjaxHandler ajaxHandler)

Sets the AJAX handler (from Spring Javascript) used to determine whether a request is an AJAX request or not.

This view class should be used with an instance of AjaxThymeleafViewResolver or any of its subclasses, so that setAjaxHandler(AjaxHandler) can be called by the resolver when resolving the view, setting the default AJAX handler being used.

Parameters:
ajaxHandler - the AJAX handler.

render

public void render(Map<String,?> model,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws Exception
Specified by:
render in interface org.springframework.web.servlet.View
Overrides:
render in class ThymeleafView
Throws:
Exception

getRenderFragments

protected String[] getRenderFragments(Map model,
                                      javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)


Copyright © 2012 The THYMELEAF team. All Rights Reserved.