Skip navigation links


javax.portlet.filter
Class ActionRequestWrapper

java.lang.Object
  extended by javax.portlet.filter.PortletRequestWrapper
      extended by javax.portlet.filter.ActionRequestWrapper

All Implemented Interfaces
ActionRequest, ClientDataRequest, PortletRequest

public class ActionRequestWrapper
extends PortletRequestWrapper
implements ActionRequest

The ActionRequestWrapper provides a convenient implementation of the ActionRequest interface that can be subclassed by developers wishing to adapt the request. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.

Since:
2.0
See Also
ActionRequest

Nested Class Summary

 

Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
PortletRequest.P3PUserInfos

 

Field Summary

 

Fields inherited from interface javax.portlet.ActionRequest
ACTION_NAME

 

Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO

 

Constructor Summary
ActionRequestWrapper(ActionRequest request)
          Creates an ActionRequest adaptor wrapping the given request object.

 

Method Summary
 String getCharacterEncoding()
          The default behavior of this method is to call getCharacterEncoding() on the wrapped request object.
 int getContentLength()
          The default behavior of this method is to call getContentLength() on the wrapped request object.
 String getContentType()
          The default behavior of this method is to call getContentType() on the wrapped request object.
 String getMethod()
          The default behavior of this method is to call getMethod() on the wrapped request object.
 InputStream getPortletInputStream()
          The default behavior of this method is to call getPortletInputStream() on the wrapped request object.
 BufferedReader getReader()
          The default behavior of this method is to call getReader() on the wrapped request object.
 ActionRequest getRequest()
          Return the wrapped request object.
 void setCharacterEncoding(String enc)
          The default behavior of this method is to call setCharacterEncoding(String enc) on the wrapped request object.
 void setRequest(ActionRequest request)
          Sets the request object being wrapped.

 

Methods inherited from class javax.portlet.filter.PortletRequestWrapper
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute, setRequest

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute

 

Constructor Detail

ActionRequestWrapper

public ActionRequestWrapper(ActionRequest request)
Creates an ActionRequest adaptor wrapping the given request object.
Parameters
request - the action request to wrap
Throws
IllegalArgumentException - if the request is null

Method Detail

getCharacterEncoding

public String getCharacterEncoding()
The default behavior of this method is to call getCharacterEncoding() on the wrapped request object.
Specified by:
getCharacterEncoding in interface ClientDataRequest
Returns
a String containing the name of the character encoding, or null if the request does not specify a character encoding.

getContentLength

public int getContentLength()
The default behavior of this method is to call getContentLength() on the wrapped request object.
Specified by:
getContentLength in interface ClientDataRequest
Returns
an integer containing the length of the request body or -1 if the length is not known

getContentType

public String getContentType()
The default behavior of this method is to call getContentType() on the wrapped request object.
Specified by:
getContentType in interface ClientDataRequest
Returns
a String containing the name of the MIME type of the request, or null if the type is not known.

getPortletInputStream

public InputStream getPortletInputStream()
                                  throws IOException
The default behavior of this method is to call getPortletInputStream() on the wrapped request object.
Specified by:
getPortletInputStream in interface ClientDataRequest
Returns
an input stream containing the body of the request
Throws
IOException - if an input or output exception occurred

getReader

public BufferedReader getReader()
                         throws UnsupportedEncodingException,
                                IOException
The default behavior of this method is to call getReader() on the wrapped request object.
Specified by:
getReader in interface ClientDataRequest
Returns
a BufferedReader containing the body of the request
Throws
UnsupportedEncodingException - if the character set encoding used is not supported and the text cannot be decoded
IOException - if an input or output exception occurred
See Also
ClientDataRequest.getPortletInputStream()

setCharacterEncoding

public void setCharacterEncoding(String enc)
                          throws UnsupportedEncodingException
The default behavior of this method is to call setCharacterEncoding(String enc) on the wrapped request object.
Specified by:
setCharacterEncoding in interface ClientDataRequest
Parameters
enc - a String containing the name of the character encoding.
Throws
UnsupportedEncodingException - if this is not a valid encoding

getRequest

public ActionRequest getRequest()
Return the wrapped request object.
Overrides:
getRequest in class PortletRequestWrapper
Returns
the wrapped request

setRequest

public void setRequest(ActionRequest request)
Sets the request object being wrapped.
Parameters
request - the request to set
Throws
IllegalArgumentException - if the request is null.

getMethod

public String getMethod()
The default behavior of this method is to call getMethod() on the wrapped request object.
Specified by:
getMethod in interface ClientDataRequest
Returns
a String specifying the name of the HTTP method with which this request was made

Skip navigation links


Copyright © 2010, Oracle. All rights reserved.