📄 httputils.html
字号:
<A NAME="HttpUtils()"><!-- --></A><H3>HttpUtils</H3><PRE>public <B>HttpUtils</B>()</PRE><DL><DD><B>Deprecated.</B> <DD>Constructs an empty <code>HttpUtils</code> object.<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="parseQueryString(java.lang.String)"><!-- --></A><H3>parseQueryString</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Hashtable.html" title="class or interface in java.util">Hashtable</A> <B>parseQueryString</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> s)</PRE><DL><DD><B>Deprecated.</B> <DD>Parses a query string passed from the client to the server and builds a <code>HashTable</code> object with key-value pairs. The query string should be in the form of a string packaged by the GET or POST method, that is, it should have key-value pairs in the form <i>key=value</i>, with each pair separated from the next by a & character. <p>A key can appear more than once in the query string with different values. However, the key appears only once in the hashtable, with its value being an array of strings containing the multiple values sent by the query string. <p>The keys and values in the hashtable are stored in their decoded form, so any + characters are converted to spaces, and characters sent in hexadecimal notation (like <i>%xx</i>) are converted to ASCII characters.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - a string containing the query to be parsed<DT><B>Returns:</B><DD>a <code>HashTable</code> object built from the parsed key-value pairs<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the query string is invalid</DL></DD></DL><HR><A NAME="parsePostData(int, javax.servlet.ServletInputStream)"><!-- --></A><H3>parsePostData</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Hashtable.html" title="class or interface in java.util">Hashtable</A> <B>parsePostData</B>(int len, <A HREF="../../../javax/servlet/ServletInputStream.html" title="class in javax.servlet">ServletInputStream</A> in)</PRE><DL><DD><B>Deprecated.</B> <DD>Parses data from an HTML form that the client sends to the server using the HTTP POST method and the <i>application/x-www-form-urlencoded</i> MIME type. <p>The data sent by the POST method contains key-value pairs. A key can appear more than once in the POST data with different values. However, the key appears only once in the hashtable, with its value being an array of strings containing the multiple values sent by the POST method. <p>The keys and values in the hashtable are stored in their decoded form, so any + characters are converted to spaces, and characters sent in hexadecimal notation (like <i>%xx</i>) are converted to ASCII characters.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>len</CODE> - an integer specifying the length, in characters, of the <code>ServletInputStream</code> object that is also passed to this method<DD><CODE>in</CODE> - the <code>ServletInputStream</code> object that contains the data sent from the client<DT><B>Returns:</B><DD>a <code>HashTable</code> object built from the parsed key-value pairs<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the data sent by the POST method is invalid</DL></DD></DL><HR><A NAME="getRequestURL(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>getRequestURL</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/StringBuffer.html" title="class or interface in java.lang">StringBuffer</A> <B>getRequestURL</B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A> req)</PRE><DL><DD><B>Deprecated.</B> <DD>Reconstructs the URL the client used to make the request, using information in the <code>HttpServletRequest</code> object. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters. <p>Because this method returns a <code>StringBuffer</code>, not a string, you can modify the URL easily, for example, to append query parameters. <p>This method is useful for creating redirect messages and for reporting errors.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>req</CODE> - a <code>HttpServletRequest</code> object containing the client's request<DT><B>Returns:</B><DD>a <code>StringBuffer</code> object containing the reconstructed URL</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="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></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/servlet/http/HttpSessionListener.html" title="interface in javax.servlet.http"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/servlet/http/HttpUtils.html" target="_top"><B>FRAMES</B></A> <A HREF="HttpUtils.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 | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -