⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpservlet.html

📁 j2ee api,很好的api。我这现在有
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServlet.html#doOptions(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doOptions</A></B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A>&nbsp;req,          <A HREF="../../../javax/servlet/http/HttpServletResponse.html" title="interface in javax.servlet.http">HttpServletResponse</A>&nbsp;resp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called by the server (via the <code>service</code> method) to allow a servlet to handle a OPTIONS request. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServlet.html#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doPost</A></B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A>&nbsp;req,       <A HREF="../../../javax/servlet/http/HttpServletResponse.html" title="interface in javax.servlet.http">HttpServletResponse</A>&nbsp;resp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called by the server (via the <code>service</code> method) to allow a servlet to handle a POST request. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServlet.html#doPut(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doPut</A></B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A>&nbsp;req,      <A HREF="../../../javax/servlet/http/HttpServletResponse.html" title="interface in javax.servlet.http">HttpServletResponse</A>&nbsp;resp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called by the server (via the <code>service</code> method) to allow a servlet to handle a PUT request. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServlet.html#doTrace(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doTrace</A></B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A>&nbsp;req,        <A HREF="../../../javax/servlet/http/HttpServletResponse.html" title="interface in javax.servlet.http">HttpServletResponse</A>&nbsp;resp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called by the server (via the <code>service</code> method) to allow a servlet to handle a TRACE request. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServlet.html#getLastModified(javax.servlet.http.HttpServletRequest)">getLastModified</A></B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A>&nbsp;req)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the time the <code>HttpServletRequest</code> object was last modified, in milliseconds since midnight January 1, 1970 GMT. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServlet.html#service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">service</A></B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A>&nbsp;req,        <A HREF="../../../javax/servlet/http/HttpServletResponse.html" title="interface in javax.servlet.http">HttpServletResponse</A>&nbsp;resp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Receives standard HTTP requests from the public <code>service</code> method and dispatches them to the <code>do</code><i>XXX</i> methods defined in  this class. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServlet.html#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)">service</A></B>(<A HREF="../../../javax/servlet/ServletRequest.html" title="interface in javax.servlet">ServletRequest</A>&nbsp;req,        <A HREF="../../../javax/servlet/ServletResponse.html" title="interface in javax.servlet">ServletResponse</A>&nbsp;res)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dispatches client requests to the protected <code>service</code> method. </TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_javax.servlet.GenericServlet"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class javax.servlet.<A HREF="../../../javax/servlet/GenericServlet.html" title="class in javax.servlet">GenericServlet</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/servlet/GenericServlet.html#destroy()">destroy</A>, <A HREF="../../../javax/servlet/GenericServlet.html#getInitParameter(java.lang.String)">getInitParameter</A>, <A HREF="../../../javax/servlet/GenericServlet.html#getInitParameterNames()">getInitParameterNames</A>, <A HREF="../../../javax/servlet/GenericServlet.html#getServletConfig()">getServletConfig</A>, <A HREF="../../../javax/servlet/GenericServlet.html#getServletContext()">getServletContext</A>, <A HREF="../../../javax/servlet/GenericServlet.html#getServletInfo()">getServletInfo</A>, <A HREF="../../../javax/servlet/GenericServlet.html#getServletName()">getServletName</A>, <A HREF="../../../javax/servlet/GenericServlet.html#init()">init</A>, <A HREF="../../../javax/servlet/GenericServlet.html#init(javax.servlet.ServletConfig)">init</A>, <A HREF="../../../javax/servlet/GenericServlet.html#log(java.lang.String)">log</A>, <A HREF="../../../javax/servlet/GenericServlet.html#log(java.lang.String, java.lang.Throwable)">log</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="HttpServlet()"><!-- --></A><H3>HttpServlet</H3><PRE>public <B>HttpServlet</B>()</PRE><DL><DD>Does nothing, because this is an abstract class.<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>doGet</H3><PRE>protected void <B>doGet</B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A>&nbsp;req,                     <A HREF="../../../javax/servlet/http/HttpServletResponse.html" title="interface in javax.servlet.http">HttpServletResponse</A>&nbsp;resp)              throws <A HREF="../../../javax/servlet/ServletException.html" title="class in javax.servlet">ServletException</A>,                     <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Called by the server (via the <code>service</code> method) to allow a servlet to handle a GET request.  <p>Overriding this method to support a GET request also automatically supports an HTTP HEAD request. A HEAD request is a GET request that returns no body in the response, only the request header fields. <p>When overriding this method, read the request data, write the response headers, get the response's writer or  output stream object, and finally, write the response data. It's best to include content type and encoding. When using a <code>PrintWriter</code> object to return the response, set the content type before accessing the <code>PrintWriter</code> object. <p>The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body. <p>Where possible, set the Content-Length header (with the <A HREF="../../../javax/servlet/ServletResponse.html#setContentLength(int)"><CODE>ServletResponse.setContentLength(int)</CODE></A> method), to allow the servlet container to use a persistent connection  to return its response to the client, improving performance. The content length is automatically set if the entire response fits inside the response buffer. <p>When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. <p>The GET method should be safe, that is, without any side effects for which users are held responsible. For example, most form queries have no side effects. If a client request is intended to change stored data, the request should use some other HTTP method. <p>The GET method should also be idempotent, meaning that it can be safely repeated. Sometimes making a method safe also makes it idempotent. For example,  repeating queries is both safe and idempotent, but buying a product online or modifying data is neither safe nor idempotent.  <p>If the request is incorrectly formatted, <code>doGet</code> returns an HTTP "Bad Request" message.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>req</CODE> - an <A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http"><CODE>HttpServletRequest</CODE></A> object that			contains the request the client has made			of the servlet<DD><CODE>resp</CODE> - an <A HREF="../../../javax/servlet/http/HttpServletResponse.html" title="interface in javax.servlet.http"><CODE>HttpServletResponse</CODE></A> object that			contains the response the servlet sends			to the client<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an input or output error is 				detected when the servlet handles				the GET request<DD><CODE><A HREF="../../../javax/servlet/ServletException.html" title="class in javax.servlet">ServletException</A></CODE> - if the request for the GET					could not be handled<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/ServletResponse.html#setContentType(java.lang.String)"><CODE>ServletResponse.setContentType(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="getLastModified(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>getLastModified</H3><PRE>protected long <B>getLastModified</B>(<A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http">HttpServletRequest</A>&nbsp;req)</PRE><DL><DD>Returns the time the <code>HttpServletRequest</code> object was last modified, in milliseconds since midnight January 1, 1970 GMT. If the time is unknown, this method returns a negative

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -