org.jboss.portal.portlet.spi
Interface ActionContext

All Superinterfaces:
InvocationContext, PortletInvocationContext
All Known Implementing Classes:
AbstractActionContext, ActionContextSupport, JSFActionContext, TestActionContext

public interface ActionContext
extends PortletInvocationContext

Extends the generic invocation context to provide action invocation specific input/services.

Version:
$Revision: 5976 $
Author:
Julien Viet

Method Summary
 java.lang.String getCharacterEncoding()
          Returns the name of the character encoding used in the body of this request.
 int getContentLength()
          Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length is not known.
 java.lang.String getContentType()
          Returns the MIME type of the body of the request, or null if the type is not known.
 PortletParameters getForm()
          Returns the form parameters of the request or null if no form could be decoded by the caller.
 java.io.InputStream getInputStream()
          Retrieves the body of the HTTP request from client to portal as binary data using an InputStream.
 StateString getInteractionState()
          Returns the interaction state of the request.
 java.io.BufferedReader getReader()
          Retrieves the body of the HTTP request from the client to the portal as character data using a BufferedReader.
 
Methods inherited from interface org.jboss.portal.portlet.spi.PortletInvocationContext
encodeResourceURL, getMarkupInfo, getMode, getNavigationalState, getWindowState, renderURL
 
Methods inherited from interface org.jboss.portal.common.invocation.InvocationContext
getAttribute, getAttributeResolver, removeAttribute, setAttribute
 

Method Detail

getCharacterEncoding

java.lang.String getCharacterEncoding()
Returns the name of the character encoding used in the body of this request. This method returns null if the request does not specify a character encoding.

Returns:
a String containing the name of the chararacter encoding, or null if the request does not specify a character encoding.

getContentLength

int getContentLength()
Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length is not known.

Returns:
an integer containing the length of the request body or -1 if the length is not known

getReader

java.io.BufferedReader getReader()
                                 throws java.io.IOException
Retrieves the body of the HTTP request from the client to the portal as character data using a BufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method or getInputStream() may be called to read the body, not both.

For HTTP POST data of type application/x-www-form-urlencoded this method throws an IllegalStateException as this data has been already processed by the portal/portlet-container and is available as request parameters.

Returns:
a BufferedReader containing the body of the request
Throws:
java.io.UnsupportedEncodingException - if the character set encoding used is not supported and the text cannot be decoded
java.lang.IllegalStateException - if getInputStream() method has been called on this request, it is a HTTP POST data of type application/x-www-form-urlencoded.
java.io.IOException - if an input or output exception occurred
See Also:
getInputStream()

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          java.lang.IllegalStateException
Retrieves the body of the HTTP request from client to portal as binary data using an InputStream. Either this method or getReader() may be called to read the body, but not both.

For HTTP POST data of type application/x-www-form-urlencoded this method throws an IllegalStateException as this data has been already processed by the portal/portlet-container and is available as request parameters.

Returns:
an input stream containing the body of the request
Throws:
java.lang.IllegalStateException - if getReader was already called, or it is a HTTP POST data of type application/x-www-form-urlencoded
java.io.IOException - if an input or output exception occurred

getContentType

java.lang.String getContentType()
Returns the MIME type of the body of the request, or null if the type is not known.

Returns:
a String containing the name of the MIME type of the request, or null if the type is not known.

getInteractionState

StateString getInteractionState()
Returns the interaction state of the request.

Returns:
the interaction state

getForm

PortletParameters getForm()
Returns the form parameters of the request or null if no form could be decoded by the caller.

Returns:
the request form