Class AjaxThymeleafView

Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.View, AjaxEnabledView
Direct Known Subclasses:
FlowAjaxThymeleafView

public class AjaxThymeleafView extends ThymeleafView implements AjaxEnabledView

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 markup selectors in a request parameter called fragments.

Since:
3.0.3
Author:
Daniel Fernández
  • Constructor Details

    • AjaxThymeleafView

      public AjaxThymeleafView()
  • Method Details

    • getAjaxHandler

      public org.springframework.webflow.context.servlet.AjaxHandler getAjaxHandler()
      Description copied from interface: AjaxEnabledView

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

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

      Specified by:
      getAjaxHandler in interface AjaxEnabledView
      Returns:
      the AJAX handler.
    • setAjaxHandler

      public void setAjaxHandler(org.springframework.webflow.context.servlet.AjaxHandler ajaxHandler)
      Description copied from interface: AjaxEnabledView

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

      Views implementing this interface should be used with an instance of AjaxThymeleafViewResolver or any of its subclasses, so that this method can be called by the resolver when resolving the view, setting the default AJAX handler being used.

      Specified by:
      setAjaxHandler in interface AjaxEnabledView
      Parameters:
      ajaxHandler - the AJAX handler.
    • render

      public void render(Map<String,?> model, jakarta.servlet.http.HttpServletRequest request, jakarta.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 Set<String> getRenderFragments(Map model, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)