?? httputils.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Mon Sep 29 15:11:57 PDT 2003 --><TITLE>: Class HttpUtils</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="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 ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT ID="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/HttpSessionEvent.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="HttpUtils.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | 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><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.servlet.http</FONT><BR>Class HttpUtils</H2><PRE>java.lang.Object | +--<B>javax.servlet.http.HttpUtils</B></PRE><HR><B>Deprecated.</B> <I>As of Java(tm) Servlet API 2.3. These methods were only useful with the default encoding and have been moved to the request interfaces.</I><P><DL><DT>public class <B>HttpUtils</B><DT>extends java.lang.Object</DL><P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpUtils.html#HttpUtils()">HttpUtils</A></B>()</CODE><BR> <B>Deprecated.</B> Constructs an empty <code>HttpUtils</code> object.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.StringBuffer</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpUtils.html#getRequestURL(javax.servlet.http.HttpServletRequest)">getRequestURL</A></B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html">HttpServletRequest</A> req)</CODE><BR> <B>Deprecated.</B> Reconstructs the URL the client used to make the request, using information in the <code>HttpServletRequest</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.util.Hashtable</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpUtils.html#parsePostData(int, javax.servlet.ServletInputStream)">parsePostData</A></B>(int len, <A HREF="../../../javax/servlet/ServletInputStream.html">ServletInputStream</A> in)</CODE><BR> <B>Deprecated.</B> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.util.Hashtable</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpUtils.html#parseQueryString(java.lang.String)">parseQueryString</A></B>(java.lang.String s)</CODE><BR> <B>Deprecated.</B> Parses a query string passed from the client to the server and builds a <code>HashTable</code> object with key-value pairs.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><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.</DL><!-- ============ METHOD DETAIL ========== --><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="parseQueryString(java.lang.String)"><!-- --></A><H3>parseQueryString</H3><PRE>public static java.util.Hashtable <B>parseQueryString</B>(java.lang.String 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.<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>java.lang.IllegalArgumentException - if the query string is invalid</DL></DD></DL><HR><A NAME="parsePostData(int, javax.servlet.ServletInputStream)"><!-- --></A><H3>parsePostData</H3><PRE>public static java.util.Hashtable <B>parsePostData</B>(int len, <A HREF="../../../javax/servlet/ServletInputStream.html">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.<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>java.lang.IllegalArgumentException - 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 java.lang.StringBuffer <B>getRequestURL</B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html">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.<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 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="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="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 ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT ID="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/HttpSessionEvent.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="HttpUtils.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | 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><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -