public class ActionRequestWrapper extends PortletRequestWrapper implements ActionRequest
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.ActionRequest
PortletRequest.P3PUserInfos
ACTION_NAME
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 and Description |
---|
ActionRequestWrapper(ActionRequest request)
Creates an
ActionRequest adaptor
wrapping the given request object. |
Modifier and Type | Method and Description |
---|---|
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.
|
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
public ActionRequestWrapper(ActionRequest request)
ActionRequest
adaptor
wrapping the given request object.request
- the action request to wrapIllegalArgumentException
- if the request is null
public String getCharacterEncoding()
getCharacterEncoding()
on the wrapped request object.getCharacterEncoding
in interface ClientDataRequest
String
containing the name of
the character encoding, or null
if the request does not specify a character encoding.public int getContentLength()
getContentLength()
on the wrapped request object.getContentLength
in interface ClientDataRequest
public String getContentType()
getContentType()
on the wrapped request object.getContentType
in interface ClientDataRequest
String
containing the name
of the MIME type of the request, or null
if the type is not known.public InputStream getPortletInputStream() throws IOException
getPortletInputStream()
on the wrapped request object.getPortletInputStream
in interface ClientDataRequest
IOException
- if an input or output exception occurredpublic BufferedReader getReader() throws UnsupportedEncodingException, IOException
getReader()
on the wrapped request object.getReader
in interface ClientDataRequest
BufferedReader
containing the body of the requestUnsupportedEncodingException
- if the character set encoding used is
not supported and the text cannot be decodedIOException
- if an input or output exception occurredClientDataRequest.getPortletInputStream()
public void setCharacterEncoding(String enc) throws UnsupportedEncodingException
setCharacterEncoding(String enc)
on the wrapped request object.setCharacterEncoding
in interface ClientDataRequest
enc
- a String
containing the name of
the character encoding.UnsupportedEncodingException
- if this is not a valid encodingpublic ActionRequest getRequest()
getRequest
in class PortletRequestWrapper
public void setRequest(ActionRequest request)
request
- the request to setIllegalArgumentException
- if the request is null.public String getMethod()
getMethod()
on the wrapped request object.getMethod
in interface ClientDataRequest
Copyright © 2004–2015 The Apache Software Foundation. All rights reserved.