org.springframework.js.ajax
Class SpringJavascriptAjaxHandler

java.lang.Object
  extended by org.springframework.js.ajax.SpringJavascriptAjaxHandler
All Implemented Interfaces:
AjaxHandler

public class SpringJavascriptAjaxHandler
extends Object
implements AjaxHandler

Ajax handler for Spring Javascript (Spring.js).

Author:
Jeremy Grelle, Keith Donald

Field Summary
static String AJAX_ACCEPT_CONTENT_TYPE
          The accept header value that signifies an Ajax request.
static String AJAX_SOURCE_PARAM
          Alternate request parameter to indicate an Ajax request for cases when control of the header is not available.
static String POPUP_VIEW_HEADER
          The response header to be set on an redirect that should be issued from a popup window.
static String REDIRECT_URL_HEADER
          The response header to be set on an Ajax redirect
 
Constructor Summary
SpringJavascriptAjaxHandler()
           
 
Method Summary
 boolean isAjaxRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Is the current request an Ajax request?
 void sendAjaxRedirect(String targetUrl, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean popup)
          Send a redirect request to the Ajax client.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REDIRECT_URL_HEADER

public static final String REDIRECT_URL_HEADER
The response header to be set on an Ajax redirect

See Also:
Constant Field Values

POPUP_VIEW_HEADER

public static final String POPUP_VIEW_HEADER
The response header to be set on an redirect that should be issued from a popup window.

See Also:
Constant Field Values

AJAX_ACCEPT_CONTENT_TYPE

public static final String AJAX_ACCEPT_CONTENT_TYPE
The accept header value that signifies an Ajax request.

See Also:
Constant Field Values

AJAX_SOURCE_PARAM

public static final String AJAX_SOURCE_PARAM
Alternate request parameter to indicate an Ajax request for cases when control of the header is not available.

See Also:
Constant Field Values
Constructor Detail

SpringJavascriptAjaxHandler

public SpringJavascriptAjaxHandler()
Method Detail

isAjaxRequest

public boolean isAjaxRequest(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
Description copied from interface: AjaxHandler
Is the current request an Ajax request?

Specified by:
isAjaxRequest in interface AjaxHandler
Parameters:
request - the current request
response - the current response

sendAjaxRedirect

public void sendAjaxRedirect(String targetUrl,
                             javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             boolean popup)
                      throws IOException
Description copied from interface: AjaxHandler
Send a redirect request to the Ajax client. This should cause the client-side agent to send a new request to the specified target url.

Specified by:
sendAjaxRedirect in interface AjaxHandler
Parameters:
targetUrl - the target url to redirect to
request - the current request
response - the current response
popup - wheter the redirect should be sent from a new popup dialog window
Throws:
IOException