Package jakarta.portlet
Interface ClientDataRequest
-
- All Superinterfaces:
PortletRequest,RenderState
- All Known Subinterfaces:
ActionRequest,ResourceRequest
- All Known Implementing Classes:
ActionRequestWrapper,ClientDataRequestWrapper,ResourceRequestWrapper
public interface ClientDataRequest extends PortletRequest
TheClientDataRequestrepresents 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jakarta.portlet.PortletRequest
PortletRequest.P3PUserInfos
-
-
Field Summary
-
Fields inherited from interface jakarta.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, HEADER_PHASE, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetCharacterEncoding()Returns the name of the character encoding used in the body of this request.intgetContentLength()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.longgetContentLengthLong()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.StringgetContentType()Returns the MIME type of the body of the request, or null if the type is not known.StringgetMethod()Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.jakarta.servlet.http.PartgetPart(String name)Gets the Part with the given name.Collection<jakarta.servlet.http.Part>getParts()Gets all the Part components of this request, provided that it is of type multipart/form-data.InputStreamgetPortletInputStream()Retrieves the body of the HTTP request from client to portal as binary data using anInputStream.BufferedReadergetReader()Retrieves the body of the HTTP request from the client to the portal as character data using aBufferedReader.voidsetCharacterEncoding(String enc)Overrides the name of the character encoding used in the body of this request.-
Methods inherited from interface jakarta.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletContext, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserAgent, getUserPrincipal, getWindowID, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute
-
Methods inherited from interface jakarta.portlet.RenderState
getPortletMode, getRenderParameters, getWindowState
-
-
-
-
Method Detail
-
getPortletInputStream
InputStream getPortletInputStream() throws IOException
Retrieves the body of the HTTP request from client to portal as binary data using anInputStream. Either this method orgetReader()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
IllegalStateExceptionas 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:
IllegalStateException- if getReader was already called, or it is a HTTP POST data of type application/x-www-form-urlencodedIOException- if an input or output exception occurred
-
setCharacterEncoding
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 usinggetReader()orgetPortletInputStream().This method only sets the character set for the Reader that the
getReader()method returns.- Parameters:
enc- aStringcontaining the name of the character encoding.- Throws:
UnsupportedEncodingException- if this is not a valid encodingIllegalStateException- if this method is called after reading request parameters or reading input usinggetReader()
-
getReader
BufferedReader getReader() throws UnsupportedEncodingException, IOException
Retrieves the body of the HTTP request from the client to the portal as character data using aBufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method orgetPortletInputStream()may be called to read the body, not both.For HTTP POST data of type application/x-www-form-urlencoded this method throws an
IllegalStateExceptionas this data has been already processed by the portal/portlet-container and is available as request parameters.- Returns:
- a
BufferedReadercontaining the body of the request - Throws:
UnsupportedEncodingException- if the character set encoding used is not supported and the text cannot be decodedIllegalStateException- ifgetPortletInputStream()method has been called on this request, it is a HTTP POST data of type application/x-www-form-urlencoded.IOException- if an input or output exception occurred- See Also:
getPortletInputStream()
-
getCharacterEncoding
String getCharacterEncoding()
Returns the name of the character encoding used in the body of this request. This method returnsnullif the request does not specify a character encoding.- Returns:
- a
Stringcontaining the name of the character encoding, ornullif the request does not specify a character encoding.
-
getContentType
String getContentType()
Returns the MIME type of the body of the request, or null if the type is not known.- Returns:
- a
Stringcontaining the name of the MIME type of the request, or null if the type is not known.
-
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
-
getContentLengthLong
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:
- a
longcontaining the length of the request body or -1 if the length is not known - Since:
- 3.0
-
getMethod
String getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.- Returns:
- a String specifying the name of the HTTP method with which this request was made
- Since:
- 2.0
-
getPart
jakarta.servlet.http.Part getPart(String name) throws IOException, PortletException
Gets the Part with the given name.- Parameters:
name- - the name of the requested 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
- Throws:
IOException- if an I/O error occurred during the retrieval of the Part components of this requestPortletException- if this request is not of type multipart/form-dataIllegalStateException- 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
-
getParts
Collection<jakarta.servlet.http.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:
- a (possibly empty) Collection of the Part components of this request
- Throws:
IOException- if an I/O error occurred during the retrieval of the Part components of this requestPortletException- if this request is not of type multipart/form-dataIllegalStateException- 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
-
-