public class DefaultAjaxHandler extends AbstractAjaxHandler
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".
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AJAX_ACCEPT_CONTENT_TYPE
"Accept" header value that indicates an Ajax request.
|
static java.lang.String |
AJAX_SOURCE_PARAM
Request parameter alternative that indicate an Ajax request.
|
static java.lang.String |
POPUP_VIEW_HEADER
Response header to be set on a redirect that should be issued from a popup window.
|
static java.lang.String |
REDIRECT_URL_HEADER
Response header to be set on an Ajax redirect with the redirect location
|
Constructor and Description |
---|
DefaultAjaxHandler()
Create 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.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
isAjaxRequestInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
sendAjaxRedirectInternal(java.lang.String targetUrl,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
boolean popup) |
isAjaxRequest, sendAjaxRedirect
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
public static final java.lang.String AJAX_ACCEPT_CONTENT_TYPE
public static final java.lang.String AJAX_SOURCE_PARAM
public static final java.lang.String REDIRECT_URL_HEADER
public static final java.lang.String POPUP_VIEW_HEADER
public DefaultAjaxHandler()
public DefaultAjaxHandler(AbstractAjaxHandler delegate)
protected boolean isAjaxRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
isAjaxRequestInternal
in class AbstractAjaxHandler
protected void sendAjaxRedirectInternal(java.lang.String targetUrl, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean popup)
sendAjaxRedirectInternal
in class AbstractAjaxHandler