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
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
Modifier and TypeFieldDescriptionstatic 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 locationFields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
-
Constructor Summary
ConstructorDescriptionCreate a DefaultAjaxHandler that is not part of a chain of AjaxHandler's.DefaultAjaxHandler
(AbstractAjaxHandler delegate) Create a DefaultAjaxHandler as part of a chain of AjaxHandler's. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
-
Field Details
-
AJAX_ACCEPT_CONTENT_TYPE
"Accept" header value that indicates an Ajax request.- See Also:
-
AJAX_SOURCE_PARAM
Request parameter alternative that indicate an Ajax request.- See Also:
-
REDIRECT_URL_HEADER
Response header to be set on an Ajax redirect with the redirect location- See Also:
-
POPUP_VIEW_HEADER
Response header to be set on a redirect that should be issued from a popup window.- See Also:
-
-
Constructor Details
-
DefaultAjaxHandler
public DefaultAjaxHandler()Create a DefaultAjaxHandler that is not part of a chain of AjaxHandler's. -
DefaultAjaxHandler
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 classAbstractAjaxHandler
-
sendAjaxRedirectInternal
protected void sendAjaxRedirectInternal(String targetUrl, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, boolean popup) - Specified by:
sendAjaxRedirectInternal
in classAbstractAjaxHandler
-