org.apache.cocoon.environment.portlet
Class ActionResponse

java.lang.Object
  extended by org.apache.cocoon.environment.portlet.PortletResponse
      extended by org.apache.cocoon.environment.portlet.ActionResponse
All Implemented Interfaces:
Response

public final class ActionResponse
extends PortletResponse

Implements the Response interface for the JSR-168 (Portlet) environment.

Version:
CVS $Id: ActionResponse.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Vadim Gritsenko

Constructor Summary
protected ActionResponse(javax.portlet.ActionResponse response, javax.portlet.PortletPreferences preferences, ActionRequest request, String uri)
          Creates a ActionResponse based on a real ActionResponse object
 
Method Summary
 void addHeader(String name, String value)
          Adds a response header with the given name and value.
 javax.portlet.ActionResponse getActionResponse()
          Type cast portletResponse to ActionResponse
 void sendRedirect(String location)
          Implements redirect.
 void setHeader(String name, String value)
          Sets a response header with the given name and value.
 void setPortletMode(javax.portlet.PortletMode mode)
           
 void setRenderParameter(String key, String value)
           
 void setRenderParameter(String key, String[] values)
           
 void setRenderParameters(Map parameters)
           
 void setWindowState(javax.portlet.WindowState state)
           
 
Methods inherited from class org.apache.cocoon.environment.portlet.PortletResponse
addCookie, addDateHeader, addIntHeader, addProperty, containsHeader, createCookie, encodeURL, getCharacterEncoding, getLocale, getPortletResponse, setDateHeader, setIntHeader, setLocale, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionResponse

protected ActionResponse(javax.portlet.ActionResponse response,
                         javax.portlet.PortletPreferences preferences,
                         ActionRequest request,
                         String uri)
Creates a ActionResponse based on a real ActionResponse object

Method Detail

addHeader

public void addHeader(String name,
                      String value)
Description copied from interface: Response
Adds a response header with the given name and value. This method allows response headers to have multiple values.

Specified by:
addHeader in interface Response
Overrides:
addHeader in class PortletResponse
Parameters:
name - the name of the header
value - the additional header value
See Also:
PortletEnvironment.HEADER_PORTLET_MODE, PortletEnvironment.HEADER_WINDOW_STATE

setHeader

public void setHeader(String name,
                      String value)
Description copied from interface: Response
Sets a response header with the given name and value. If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.

Specified by:
setHeader in interface Response
Overrides:
setHeader in class PortletResponse
Parameters:
name - the name of the header
value - the header value
See Also:
PortletEnvironment.HEADER_PORTLET_MODE, PortletEnvironment.HEADER_WINDOW_STATE

sendRedirect

public void sendRedirect(String location)
                  throws IOException
Implements redirect. Redirects to self (starting with the question mark) are processed differently from other redirects: redirect parameters are parsed and set on response using setRenderParameter(String, String) method, sendRedirect(String) method is not called.

Parameters:
location -
Throws:
IOException

getActionResponse

public javax.portlet.ActionResponse getActionResponse()
Type cast portletResponse to ActionResponse

Returns:
type casted portletResponse

setPortletMode

public void setPortletMode(javax.portlet.PortletMode mode)
                    throws javax.portlet.PortletModeException
Throws:
javax.portlet.PortletModeException

setRenderParameter

public void setRenderParameter(String key,
                               String value)

setRenderParameter

public void setRenderParameter(String key,
                               String[] values)

setRenderParameters

public void setRenderParameters(Map parameters)

setWindowState

public void setWindowState(javax.portlet.WindowState state)
                    throws javax.portlet.WindowStateException
Throws:
javax.portlet.WindowStateException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.