org.jasig.web.service
Interface AjaxPortletSupport

All Known Implementing Classes:
AjaxPortletSupportService

public interface AjaxPortletSupport

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
static String DEFAULT_AJAX_HANDLER_ERROR_KEY
           
static String DEFAULT_AJAX_SERVLET_NAME
           
 
Method Summary
 Map<Object,Object> getAjaxModel(HttpServletRequest request, HttpServletResponse response)
          Gets the model for the request, if the model is null a 404 is sent to the browser and null is returned.
 void redirectAjaxResponse(Map<Object,Object> model, javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
          Calls redirectAjaxResponse(String, Map, ActionRequest, ActionResponse) passing DEFAULT_AJAX_SERVLET_NAME for the servlet name.
 void redirectAjaxResponse(String ajaxServletName, Map<Object,Object> model, javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
          Generates a new session key and uses that to pass the model to the servlet.
 

Field Detail

DEFAULT_AJAX_SERVLET_NAME

static final String DEFAULT_AJAX_SERVLET_NAME
See Also:
Constant Field Values

DEFAULT_AJAX_HANDLER_ERROR_KEY

static final String DEFAULT_AJAX_HANDLER_ERROR_KEY
See Also:
Constant Field Values
Method Detail

redirectAjaxResponse

void redirectAjaxResponse(String ajaxServletName,
                          Map<Object,Object> model,
                          javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                          throws IOException
Generates a new session key and uses that to pass the model to the servlet. The response will be redirected to the ajax handling servlet by this method.

Parameters:
ajaxServletName - Name of the ajax servlet to redirect to, the full redirect URL is generated by #getAjaxServletUrl(ActionRequest, ActionResponse, String, String)
model - The data model to pass to the servlet
Throws:
IOException

redirectAjaxResponse

void redirectAjaxResponse(Map<Object,Object> model,
                          javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                          throws IOException
Calls redirectAjaxResponse(String, Map, ActionRequest, ActionResponse) passing DEFAULT_AJAX_SERVLET_NAME for the servlet name.

Throws:
IOException

getAjaxModel

Map<Object,Object> getAjaxModel(HttpServletRequest request,
                                HttpServletResponse response)
                                throws ServletRequestBindingException,
                                       IOException
Gets the model for the request, if the model is null a 404 is sent to the browser and null is returned. If the model contains the key DEFAULT_AJAX_HANDLER_ERROR_KEY a 500 is sent to the browser but the model is still returned for rendering.

Throws:
ServletRequestBindingException
IOException


Copyright © 2009 Jasig. All Rights Reserved.