Class DefaultAjaxHandler

java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.webflow.context.servlet.AbstractAjaxHandler
org.springframework.webflow.context.servlet.DefaultAjaxHandler
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, AjaxHandler

public class DefaultAjaxHandler extends AbstractAjaxHandler
Default AjaxHandler implementation.

Detects Ajax requests through an "Accept" header with the value AJAX_ACCEPT_CONTENT_TYPE or a request parameter with the name AJAX_SOURCE_PARAM.

Also for a redirect during an Ajax request it sets the response headers REDIRECT_URL_HEADER and POPUP_VIEW_HEADER. The latter is set if the redirect occurs on a view state with popup="true".

Since:
2.5
Author:
Rossen Stoyanchev
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    "Accept" header value that indicates an Ajax request.
    static final String
    Request parameter alternative that indicate an Ajax request.
    static final String
    Response header to be set on a redirect that should be issued from a popup window.
    static final String
    Response header to be set on an Ajax redirect with the redirect location

    Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a DefaultAjaxHandler that is not part of a chain of AjaxHandler's.
    Create a DefaultAjaxHandler as part of a chain of AjaxHandler's.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    isAjaxRequestInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    protected void
    sendAjaxRedirectInternal(String targetUrl, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, boolean popup)
     

    Methods inherited from class org.springframework.webflow.context.servlet.AbstractAjaxHandler

    isAjaxRequest, sendAjaxRedirect

    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, obtainApplicationContext, requiredContextClass, setApplicationContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • AJAX_ACCEPT_CONTENT_TYPE

      public static final String AJAX_ACCEPT_CONTENT_TYPE
      "Accept" header value that indicates an Ajax request.
      See Also:
    • AJAX_SOURCE_PARAM

      public static final String AJAX_SOURCE_PARAM
      Request parameter alternative that indicate an Ajax request.
      See Also:
    • REDIRECT_URL_HEADER

      public static final String REDIRECT_URL_HEADER
      Response header to be set on an Ajax redirect with the redirect location
      See Also:
  • Constructor Details

    • DefaultAjaxHandler

      public DefaultAjaxHandler()
      Create a DefaultAjaxHandler that is not part of a chain of AjaxHandler's.
    • DefaultAjaxHandler

      public DefaultAjaxHandler(AbstractAjaxHandler delegate)
      Create a DefaultAjaxHandler as part of a chain of AjaxHandler's.
  • Method Details

    • isAjaxRequestInternal

      protected boolean isAjaxRequestInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Specified by:
      isAjaxRequestInternal in class AbstractAjaxHandler
    • sendAjaxRedirectInternal

      protected void sendAjaxRedirectInternal(String targetUrl, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, boolean popup)
      Specified by:
      sendAjaxRedirectInternal in class AbstractAjaxHandler