📄 actionrequest.html.svn-base
字号:
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getPortletInputStream()"><!-- --></A><H3>getPortletInputStream</H3><PRE>public 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/ActionRequest.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.<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>public 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/ActionRequest.html#getReader()"><CODE>getReader()</CODE></A> or <A HREF="../../javax/portlet/ActionRequest.html#getPortletInputStream()"><CODE>getPortletInputStream()</CODE></A>. <p> This method only sets the character set for the Reader that the <A HREF="../../javax/portlet/ActionRequest.html#getReader()"><CODE>getReader()</CODE></A> method returns.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>enc</CODE> - a <code>String</code> containing the name of the chararacter 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>public 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/ActionRequest.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.<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/ActionRequest.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/ActionRequest.html#getPortletInputStream()"><CODE>getPortletInputStream()</CODE></A></DL></DD></DL><HR><A NAME="getCharacterEncoding()"><!-- --></A><H3>getCharacterEncoding</H3><PRE>public 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.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> containing the name of the chararacter 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>public 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.<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>public 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.<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><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <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="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-all.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>Portlet API (V1.0) </EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../javax/portlet/ActionResponse.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ActionRequest.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | 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><!-- =========== END OF NAVBAR =========== --><HR><a href=license.txt >Copyright</a> © 2003 IBM Corporation and Sun Microsystems, Inc. All rights reserved</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -