org.jasig.web.portlet.mvc
Class AbstractAjaxController
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.portlet.context.PortletApplicationObjectSupport
org.springframework.web.portlet.handler.PortletContentGenerator
org.springframework.web.portlet.mvc.AbstractController
org.jasig.web.portlet.mvc.AbstractAjaxController
- All Implemented Interfaces:
- ApplicationContextAware, PortletContextAware, Controller
public abstract class AbstractAjaxController
- extends AbstractController
Base class for AJAX portlet callbacks that handles passing the model to the ajax response
servlet via a unique random attribute.
- Version:
- $Revision$
- Author:
- Eric Dalquist
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_AJAX_SERVLET_NAME
public static final String DEFAULT_AJAX_SERVLET_NAME
- See Also:
- Constant Field Values
DEFAULT_AJAX_HANDLER_ERROR_KEY
public static final String DEFAULT_AJAX_HANDLER_ERROR_KEY
- See Also:
- Constant Field Values
AbstractAjaxController
public AbstractAjaxController()
getSessionKeyGenerator
public SessionKeyGenerator getSessionKeyGenerator()
setSessionKeyGenerator
public void setSessionKeyGenerator(SessionKeyGenerator sessionKeyGenerator)
- Used to generate unique keys within a portlet session. Defaults to
SecureSessionKeyGenerator
getModelPasser
public ModelPasser getModelPasser()
setModelPasser
public void setModelPasser(ModelPasser modelPasser)
- Used to pass the model data to the rendering servlet. Defaults to
DefaultModelPasser
getAjaxHandlerErrorKey
public String getAjaxHandlerErrorKey()
setAjaxHandlerErrorKey
public void setAjaxHandlerErrorKey(String ajaxHandlerErrorKey)
- Model attribute used to pass an exception object to the rendering serlvet if one occurs
from calling
AbstractController.handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse).
Defaults to the value of DEFAULT_AJAX_HANDLER_ERROR_KEY
getAjaxServletName
public String getAjaxServletName()
setAjaxServletName
public void setAjaxServletName(String ajaxServletName)
- The path to the rendering serlvet do redirect the request to after the model data has been passed.
Defaults to the value of
DEFAULT_AJAX_SERVLET_NAME
handleActionRequestInternal
protected final void handleActionRequestInternal(javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response)
throws Exception
- Overrides:
handleActionRequestInternal in class AbstractController
- Throws:
Exception
getAjaxServletUrl
protected String getAjaxServletUrl(javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response,
String sessionKey)
throws UnsupportedEncodingException
- Generate the servlet URL to redirect the AJAX request to for rendering the response model. The
URL will be encoded via
PortletResponse.encodeURL(String) before the redirect is sent.
- Parameters:
sessionKey - The session key to provide on the URL
- Throws:
UnsupportedEncodingException
handleAjaxRequestInternal
protected abstract Map<Object,Object> handleAjaxRequestInternal(javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response)
throws Exception
- Called by
handleActionRequestInternal(ActionRequest, ActionResponse) to handle the ajax callback.
The returned model will be passed to the AjaxResponseController via the ModelPasser.passModelToServlet(ActionRequest, ActionResponse, String, Map)
method.
- Throws:
Exception- See Also:
handleActionRequestInternal(ActionRequest, ActionResponse)
Copyright © 2009 Jasig. All Rights Reserved.