📄 clientdatarequest.html.svn-base
字号:
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getPortletInputStream()"><!-- --></A><H3>getPortletInputStream</H3><PRE>java.io.InputStream <B>getPortletInputStream</B>() throws java.io.IOException</PRE><DL><DD>Retrieves the body of the HTTP request from client to portal as binary data using an <CODE>InputStream</CODE>. Either this method or <A HREF="../../javax/portlet/ClientDataRequest.html#getReader()"><CODE>getReader()</CODE></A> may be called to read the body, but not both. <p> For HTTP POST data of type application/x-www-form-urlencoded this method throws an <code>IllegalStateException</code> as this data has been already processed by the portal/portlet-container and is available as request parameters.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an input stream containing the body of the request<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if getReader was already called, or it is a HTTP POST data of type application/x-www-form-urlencoded<DD><CODE>java.io.IOException</CODE> - if an input or output exception occurred</DL></DD></DL><HR><A NAME="setCharacterEncoding(java.lang.String)"><!-- --></A><H3>setCharacterEncoding</H3><PRE>void <B>setCharacterEncoding</B>(java.lang.String enc) throws java.io.UnsupportedEncodingException</PRE><DL><DD>Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading input using <A HREF="../../javax/portlet/ClientDataRequest.html#getReader()"><CODE>getReader()</CODE></A> or <A HREF="../../javax/portlet/ClientDataRequest.html#getPortletInputStream()"><CODE>getPortletInputStream()</CODE></A>. <p> This method only sets the character set for the Reader that the <A HREF="../../javax/portlet/ClientDataRequest.html#getReader()"><CODE>getReader()</CODE></A> method returns.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>enc</CODE> - a <code>String</code> containing the name of the character encoding.<DT><B>Throws:</B><DD><CODE>java.io.UnsupportedEncodingException</CODE> - if this is not a valid encoding<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called after reading request parameters or reading input using <code>getReader()</code></DL></DD></DL><HR><A NAME="getReader()"><!-- --></A><H3>getReader</H3><PRE>java.io.BufferedReader <B>getReader</B>() throws java.io.UnsupportedEncodingException, java.io.IOException</PRE><DL><DD>Retrieves the body of the HTTP request from the client to the portal as character data using a <code>BufferedReader</code>. The reader translates the character data according to the character encoding used on the body. Either this method or <A HREF="../../javax/portlet/ClientDataRequest.html#getPortletInputStream()"><CODE>getPortletInputStream()</CODE></A> may be called to read the body, not both. <p> For HTTP POST data of type application/x-www-form-urlencoded this method throws an <code>IllegalStateException</code> as this data has been already processed by the portal/portlet-container and is available as request parameters.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>BufferedReader</code> containing the body of the request<DT><B>Throws:</B><DD><CODE>java.io.UnsupportedEncodingException</CODE> - if the character set encoding used is not supported and the text cannot be decoded<DD><CODE>java.lang.IllegalStateException</CODE> - if <A HREF="../../javax/portlet/ClientDataRequest.html#getPortletInputStream()"><CODE>getPortletInputStream()</CODE></A> method has been called on this request, it is a HTTP POST data of type application/x-www-form-urlencoded.<DD><CODE>java.io.IOException</CODE> - if an input or output exception occurred<DT><B>See Also:</B><DD><A HREF="../../javax/portlet/ClientDataRequest.html#getPortletInputStream()"><CODE>getPortletInputStream()</CODE></A></DL></DD></DL><HR><A NAME="getCharacterEncoding()"><!-- --></A><H3>getCharacterEncoding</H3><PRE>java.lang.String <B>getCharacterEncoding</B>()</PRE><DL><DD>Returns the name of the character encoding used in the body of this request. This method returns <code>null</code> if the request does not specify a character encoding.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> containing the name of the character encoding, or <code>null</code> if the request does not specify a character encoding.</DL></DD></DL><HR><A NAME="getContentType()"><!-- --></A><H3>getContentType</H3><PRE>java.lang.String <B>getContentType</B>()</PRE><DL><DD>Returns the MIME type of the body of the request, or null if the type is not known.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> containing the name of the MIME type of the request, or null if the type is not known.</DL></DD></DL><HR><A NAME="getContentLength()"><!-- --></A><H3>getContentLength</H3><PRE>int <B>getContentLength</B>()</PRE><DL><DD>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.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an integer containing the length of the request body or -1 if the length is not known</DL></DD></DL><HR><A NAME="getMethod()"><!-- --></A><H3>getMethod</H3><PRE>java.lang.String <B>getMethod</B>()</PRE><DL><DD>Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a String specifying the name of the HTTP method with which this request was made<DT><B>Since:</B></DT> <DD>2.0</DD></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ClientDataRequest.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/portlet/CacheControl.html" title="interface in javax.portlet"><B>PREV CLASS</B></A> <A HREF="../../javax/portlet/Event.html" title="interface in javax.portlet"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javax/portlet/ClientDataRequest.html" target="_top"><B>FRAMES</B></A> <A HREF="ClientDataRequest.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -