Top Description Fields Methods
javax.portlet

public Interface ClientDataRequest

extends PortletRequest
Known Direct Subinterfaces
javax.portlet.ResourceRequest, javax.portlet.ActionRequest
Known Direct Implementers
javax.portlet.filter.ClientDataRequestWrapper
Imports
java.io.IOException, java.util.Collection, javax.servlet.http.Part

The ClientDataRequest represents the request information of the HTTP request issued from the client to the portal.
It extends the PortletRequest interface.
Since
2.0
See Also
PortletRequest

Field Summary

Inherited from javax.portlet.PortletRequest:
ACTION_PHASEACTION_SCOPE_IDBASIC_AUTHCCPP_PROFILECLIENT_CERT_AUTHDIGEST_AUTHEVENT_PHASEFORM_AUTHHEADER_PHASELIFECYCLE_PHASERENDER_HEADERSRENDER_MARKUPRENDER_PARTRENDER_PHASERESOURCE_PHASEUSER_INFO

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a String containing the name of the character encoding, or null if the request does not specify a character encoding.
getCharacterEncoding
()

Returns the name of the character encoding used in the body of this request.

public int

Returns:

an integer containing the length of the request body or -1 if the length is not known
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.

public long

Returns:

a long containing the length of the request body or -1 if the length is not known
getContentLengthLong
()

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.
public String

Returns:

a String containing the name of the MIME type of the request, or null if the type is not known.
getContentType
()

Returns the MIME type of the body of the request, or null if the type is not known.

public String

Returns:

a String specifying the name of the HTTP method with which this request was made
getMethod
()

Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.

public Part

Returns:

The Part with the given name, or null if this request is of type multipart/form-data, but does not contain the requested Part
getPart
(String
- the name of the requested Part
name
)

Gets the Part with the given name.
public Collection<Part>

Returns:

a (possibly empty) Collection of the Part components of this request
getParts
()

Gets all the Part components of this request, provided that it is of type multipart/form-data.
public InputStream

Returns:

an input stream containing the body of the request
getPortletInputStream
()

Retrieves the body of the HTTP request from client to portal as binary data using an InputStream.

public BufferedReader

Returns:

a BufferedReader containing the body of the request
getReader
()

Retrieves the body of the HTTP request from the client to the portal as character data using a BufferedReader.

public void
setCharacterEncoding(String
a String containing the name of the character encoding.
enc
)

Overrides the name of the character encoding used in the body of this request.

Inherited from javax.portlet.PortletRequest:
getAttributegetAttributeNamesgetAuthTypegetContextPathgetCookiesgetLocalegetLocalesgetParametergetParameterMapgetParameterNamesgetParameterValuesgetPortalContextgetPortletContextgetPortletSessiongetPortletSessiongetPreferencesgetPrivateParameterMapgetPropertiesgetPropertygetPropertyNamesgetPublicParameterMapgetRemoteUsergetRequestedSessionIdgetResponseContentTypegetResponseContentTypesgetSchemegetServerNamegetServerPortgetUserAgentgetUserPrincipalgetWindowIDisPortletModeAllowedisRequestedSessionIdValidisSecureisUserInRoleisWindowStateAllowedremoveAttributesetAttribute

Method Detail

getCharacterEncodingback to summary
public 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:String

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

getContentLengthback to summary
public 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:int

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

getContentLengthLongback to summary
public long getContentLengthLong()

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:long

a long containing the length of the request body or -1 if the length is not known

Since
3.0
getContentTypeback to summary
public String getContentType()

Returns the MIME type of the body of the request, or null if the type is not known.

Returns:String

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

getMethodback to summary
public String getMethod()

Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.

Returns:String

a String specifying the name of the HTTP method with which this request was made

Since
2.0
getPartback to summary
public Part getPart(String name) throws IOException, PortletException

Gets the Part with the given name.
Parameters
name:String

- the name of the requested Part

Returns:Part

The Part with the given name, or null if this request is of type multipart/form-data, but does not contain the requested Part

Exceptions
IOException:
if an I/O error occurred during the retrieval of the Part components of this request
PortletException:
if this request is not of type multipart/form-data
IllegalStateException:
if the request body is larger than maxRequestSize, or any Part in the request is larger than maxFileSize, or there is no multipart configuration present
Since
3.0
getPartsback to summary
public Collection<Part> getParts() throws IOException, PortletException

Gets all the Part components of this request, provided that it is of type multipart/form-data.

If this request is of type multipart/form-data, but does not contain any Part components, the returned Collection will be empty.

Any changes to the returned Collection must not affect this request object.

Returns:Collection<Part>

a (possibly empty) Collection of the Part components of this request

Exceptions
IOException:
if an I/O error occurred during the retrieval of the Part components of this request
PortletException:
if this request is not of type multipart/form-data
IllegalStateException:
if the request body is larger than maxRequestSize, or any Part in the request is larger than maxFileSize, or there is no multipart configuration present
Since
3.0
getPortletInputStreamback to summary
public InputStream getPortletInputStream() throws IOException

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:InputStream

an input stream containing the body of the request

Exceptions
IOException:
if an input or output exception occurred
IllegalStateException:
if getReader was already called, or it is a HTTP POST data of type application/x-www-form-urlencoded
getReaderback to summary
public BufferedReader getReader() throws UnsupportedEncodingException, 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 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.

Returns:BufferedReader

a BufferedReader containing the body of the request

Exceptions
UnsupportedEncodingException:
if the character set encoding used is not supported and the text cannot be decoded
IOException:
if an input or output exception occurred
IllegalStateException:
if getPortletInputStream method has been called on this request, it is a HTTP POST data of type application/x-www-form-urlencoded.
See Also
getPortletInputStream
setCharacterEncodingback to summary
public void setCharacterEncoding(String enc) throws UnsupportedEncodingException

Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading input using getReader or getPortletInputStream.

This method only sets the character set for the Reader that the getReader method returns.

Parameters
enc:String

a String containing the name of the character encoding.

Exceptions
UnsupportedEncodingException:
if this is not a valid encoding
IllegalStateException:
if this method is called after reading request parameters or reading input using getReader()