|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
org.apache.pluto.wrappers.PortletRequestWrapper
org.apache.pluto.wrappers.ActionRequestWrapper
public class ActionRequestWrapper
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 |
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
---|---|
ActionRequestWrapper(ActionRequest actionRequest)
Creates a ServletRequest adaptor wrapping the given request object. |
Method Summary | |
---|---|
ActionRequest |
getActionRequest()
Return the wrapped ServletRequest object. |
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. |
String |
getContentType()
Returns the MIME type of the body of the request, or null if the type is not known. |
InputStream |
getPortletInputStream()
Retrieves the body of the HTTP request from client to portal as binary data using an InputStream . |
BufferedReader |
getReader()
Retrieves the body of the HTTP request from the client to the portal as character data using a BufferedReader . |
void |
setCharacterEncoding(String enc)
Overrides the name of the character encoding used in the body of this request. |
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper |
---|
getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL |
Methods inherited from class javax.servlet.ServletRequestWrapper |
---|
getInputStream, getLocalAddr, getLocalName, getLocalPort, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, 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.ClientDataRequest |
---|
getMethod |
Methods inherited from interface javax.servlet.ServletRequest |
---|
getInputStream, getLocalAddr, getLocalName, getLocalPort, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher |
Constructor Detail |
---|
public ActionRequestWrapper(ActionRequest actionRequest)
IllegalArgumentException
- if the request is null.Method Detail |
---|
public InputStream getPortletInputStream() throws IOException
ClientDataRequest
InputStream
. Either this method or
ClientDataRequest.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.
getPortletInputStream
in interface ClientDataRequest
IOException
- if an input or output exception occurredpublic void setCharacterEncoding(String enc) throws UnsupportedEncodingException
ClientDataRequest
ClientDataRequest.getReader()
or ClientDataRequest.getPortletInputStream()
.
This method only sets the character set for the Reader that the
ClientDataRequest.getReader()
method returns.
setCharacterEncoding
in interface ClientDataRequest
setCharacterEncoding
in interface javax.servlet.ServletRequest
setCharacterEncoding
in class javax.servlet.ServletRequestWrapper
enc
- a String
containing the name of
the character encoding.
UnsupportedEncodingException
- if this is not a valid encodingpublic BufferedReader getReader() throws UnsupportedEncodingException, IOException
ClientDataRequest
BufferedReader
. The reader translates the character
data according to the character encoding used on the body.
Either this method or ClientDataRequest.getPortletInputStream()
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.
getReader
in interface ClientDataRequest
getReader
in interface javax.servlet.ServletRequest
getReader
in class javax.servlet.ServletRequestWrapper
BufferedReader
containing the body of the request
UnsupportedEncodingException
- if the character set encoding used is
not supported and the text cannot be decoded
IOException
- if an input or output exception occurredClientDataRequest.getPortletInputStream()
public String getCharacterEncoding()
ClientDataRequest
null
if the request
does not specify a character encoding.
getCharacterEncoding
in interface ClientDataRequest
getCharacterEncoding
in interface javax.servlet.ServletRequest
getCharacterEncoding
in class javax.servlet.ServletRequestWrapper
String
containing the name of
the character encoding, or null
if the request does not specify a character encoding.public String getContentType()
ClientDataRequest
getContentType
in interface ClientDataRequest
getContentType
in interface javax.servlet.ServletRequest
getContentType
in class javax.servlet.ServletRequestWrapper
String
containing the name
of the MIME type of the request, or null
if the type is not known.public int getContentLength()
ClientDataRequest
getContentLength
in interface ClientDataRequest
getContentLength
in interface javax.servlet.ServletRequest
getContentLength
in class javax.servlet.ServletRequestWrapper
public ActionRequest getActionRequest()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |