Package javax.portlet
Interface ActionResponse
-
- All Superinterfaces:
PortletResponse
public interface ActionResponse extends PortletResponse
TheActionResponseinterface represents the portlet response to an action request. It extends thePortletResponseinterface to provide specific action response functionality to portlets.
The portlet container creates anActionResponseobject and passes it as argument to the portlet'sprocessActionmethod.- Version:
- $Revision: 5441 $
- Author:
- Julien Viet
- See Also:
ActionRequest,PortletResponse
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidsendRedirect(String location)Instructs the portlet container to send a redirect response to the client using the specified redirect location URL.voidsetPortletMode(PortletMode portletMode)Sets the portlet mode of a portlet to the given portlet mode.voidsetRenderParameter(String key, String value)Sets a String parameter for the render request.voidsetRenderParameter(String key, String[] values)Sets a String array parameter for the render request.voidsetRenderParameters(Map parameters)Sets a parameter map for the render request.voidsetWindowState(WindowState windowState)Sets the window state of a portlet to the given window state.-
Methods inherited from interface javax.portlet.PortletResponse
addProperty, encodeURL, setProperty
-
-
-
-
Method Detail
-
setWindowState
void setWindowState(WindowState windowState) throws WindowStateException
Sets the window state of a portlet to the given window state. Possible values are the standard window states and any custom window states supported by the portal and the portlet. Standard window states are:- MINIMIZED
- NORMAL
- MAXIMIZED
- Parameters:
windowState- the new portlet window state- Throws:
WindowStateException- if the portlet cannot switch to the specified window state. To avoid this exception the portlet can check the allowed window states withRequest.isWindowStateAllowed().IllegalStateException- if the method is invoked aftersendRedirecthas been called.- See Also:
WindowState
-
setPortletMode
void setPortletMode(PortletMode portletMode) throws PortletModeException
Sets the portlet mode of a portlet to the given portlet mode. Possible values are the standard portlet modes and any custom portlet modes supported by the portal and the portlet. Portlets must declare in the deployment descriptor the portlet modes they support for each markup type. Standard portlet modes are:- EDIT
- HELP
- VIEW
- Parameters:
portletMode- the new portlet mode- Throws:
PortletModeException- if the portlet cannot switch to this portlet mode, because the portlet or portal does not support it for this markup, or the current user is not allowed to switch to this portlet mode. To avoid this exception the portlet can check the allowed portlet modes withRequest.isPortletModeAllowed().IllegalStateException- if the method is invoked aftersendRedirecthas been called.
-
sendRedirect
void sendRedirect(String location) throws IOException, IllegalArgumentException, IllegalStateException
Instructs the portlet container to send a redirect response to the client using the specified redirect location URL. This method only accepts an absolute URL (e.g.http://my.co/myportal/mywebap/myfolder/myresource.gif) or a full path URI (e.g./myportal/mywebap/myfolder/myresource.gif). If required, the portlet container may encode the given URL before the redirection is issued to the client. The sendRedirect method can not be invoked after any of the following methods of the ActionResponse interface has been called:- setPortletMode
- setWindowState
- setRenderParameter
- setRenderParameters
- Parameters:
location- the redirect location URL- Throws:
IllegalStateException- if the method is invoked after any of above mentioned methods of the ActionResponse interface has been called.IOException- if an input or output exception occurs.IllegalArgumentException- if a relative path URL is given
-
setRenderParameters
void setRenderParameters(Map parameters) throws IllegalArgumentException, IllegalStateException
Sets a parameter map for the render request. All previously set render parameters are cleared. These parameters will be accessible in all sub-sequent render calls via thePortletRequest.getParametercall until a new request is targeted to the portlet. The given parameters do not need to be encoded prior to calling this method.- Parameters:
parameters- Map containing parameter names for the render phase as keys and parameter values as map values. The keys in the parameter map must be of type String. The values in the parameter map must be of type String array (String[]).- Throws:
IllegalStateException- if the method is invoked aftersendRedirecthas been called.IllegalArgumentException- if parameters isnull, if any of the key/values in the Map arenull, if any of the keys is not a String, or if any of the values is not a String array.
-
setRenderParameter
void setRenderParameter(String key, String value) throws IllegalArgumentException, IllegalStateException
Sets a String parameter for the render request. These parameters will be accessible in all sub-sequent render calls via thePortletRequest.getParametercall until a request is targeted to the portlet. This method replaces all parameters with the given key. The given parameter do not need to be encoded prior to calling this method.- Parameters:
key- key of the render parametervalue- value of the render parameter- Throws:
IllegalStateException- if the method is invoked aftersendRedirecthas been called.IllegalArgumentException- if key or value arenull.
-
setRenderParameter
void setRenderParameter(String key, String[] values) throws IllegalArgumentException, IllegalStateException
Sets a String array parameter for the render request. These parameters will be accessible in all sub-sequent render calls via thePortletRequest.getParametercall until a request is targeted to the portlet. This method replaces all parameters with the given key. The given parameter do not need to be encoded prior to calling this method.- Parameters:
key- key of the render parametervalues- values of the render parameter- Throws:
IllegalStateException- if the method is invoked aftersendRedirecthas been called.IllegalArgumentException- if key or value arenull.
-
-