📄 httpservletresponse.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2_02) on Thu Nov 13 17:20:50 PST 2003 --><TITLE>HttpServletResponse (Java 2 Platform Ent. Ed. v1.4)</TITLE><META NAME="keywords" CONTENT="javax.servlet.http.HttpServletResponse interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="HttpServletResponse (Java 2 Platform Ent. Ed. v1.4)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_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><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/servlet/http/HttpServletRequest.html" title="interface in javax.servlet.http"><B>PREV CLASS</B></A> <A HREF="../../../javax/servlet/http/HttpSession.html" title="interface in javax.servlet.http"><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="HttpServletResponse.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 | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.servlet.http</FONT><BR>Interface HttpServletResponse</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/servlet/ServletResponse.html" title="interface in javax.servlet">ServletResponse</A></DD></DL><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../javax/servlet/http/HttpServletResponseWrapper.html" title="class in javax.servlet.http">HttpServletResponseWrapper</A></DD></DL><HR><DL><DT>public interface <B>HttpServletResponse</B><DT>extends <A HREF="../../../javax/servlet/ServletResponse.html" title="interface in javax.servlet">ServletResponse</A></DL><P>Extends the <A HREF="../../../javax/servlet/ServletResponse.html" title="interface in javax.servlet"><CODE>ServletResponse</CODE></A> interface to provide HTTP-specific functionality in sending a response. For example, it has methods to access HTTP headers and cookies. <p>The servlet container creates an <code>HttpServletResponse</code> object and passes it as an argument to the servlet's service methods (<code>doGet</code>, <code>doPost</code>, etc).<P><P><DL><DT><B>Version:</B></DT> <DD>$Version$</DD><DT><B>Author:</B></DT> <DD>Various</DD><DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/ServletResponse.html" title="interface in javax.servlet"><CODE>ServletResponse</CODE></A></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_ACCEPTED">SC_ACCEPTED</A></B></CODE><BR> Status code (202) indicating that a request was accepted for processing, but was not completed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_BAD_GATEWAY">SC_BAD_GATEWAY</A></B></CODE><BR> Status code (502) indicating that the HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_BAD_REQUEST">SC_BAD_REQUEST</A></B></CODE><BR> Status code (400) indicating the request sent by the client was syntactically incorrect.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_CONFLICT">SC_CONFLICT</A></B></CODE><BR> Status code (409) indicating that the request could not be completed due to a conflict with the current state of the resource.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_CONTINUE">SC_CONTINUE</A></B></CODE><BR> Status code (100) indicating the client can continue.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_CREATED">SC_CREATED</A></B></CODE><BR> Status code (201) indicating the request succeeded and created a new resource on the server.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_EXPECTATION_FAILED">SC_EXPECTATION_FAILED</A></B></CODE><BR> Status code (417) indicating that the server could not meet the expectation given in the Expect request header.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_FORBIDDEN">SC_FORBIDDEN</A></B></CODE><BR> Status code (403) indicating the server understood the request but refused to fulfill it.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_FOUND">SC_FOUND</A></B></CODE><BR> Status code (302) indicating that the resource reside temporarily under a different URI. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_GATEWAY_TIMEOUT">SC_GATEWAY_TIMEOUT</A></B></CODE><BR> Status code (504) indicating that the server did not receive a timely response from the upstream server while acting as a gateway or proxy.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_GONE">SC_GONE</A></B></CODE><BR> Status code (410) indicating that the resource is no longer available at the server and no forwarding address is known. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_HTTP_VERSION_NOT_SUPPORTED">SC_HTTP_VERSION_NOT_SUPPORTED</A></B></CODE><BR> Status code (505) indicating that the server does not support or refuses to support the HTTP protocol version that was used in the request message.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_INTERNAL_SERVER_ERROR">SC_INTERNAL_SERVER_ERROR</A></B></CODE><BR> Status code (500) indicating an error inside the HTTP server which prevented it from fulfilling the request.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_LENGTH_REQUIRED">SC_LENGTH_REQUIRED</A></B></CODE><BR> Status code (411) indicating that the request cannot be handled without a defined <code><em>Content-Length</em></code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_METHOD_NOT_ALLOWED">SC_METHOD_NOT_ALLOWED</A></B></CODE><BR> Status code (405) indicating that the method specified in the <code><em>Request-Line</em></code> is not allowed for the resource identified by the <code><em>Request-URI</em></code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_MOVED_PERMANENTLY">SC_MOVED_PERMANENTLY</A></B></CODE><BR> Status code (301) indicating that the resource has permanently moved to a new location, and that future references should use a new URI with their requests.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_MOVED_TEMPORARILY">SC_MOVED_TEMPORARILY</A></B></CODE><BR> Status code (302) indicating that the resource has temporarily moved to another location, but that future references should still use the original URI to access the resource. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#SC_MULTIPLE_CHOICES">SC_MULTIPLE_CHOICES</A></B></CODE><BR> Status code (300) indicating that the requested resource corresponds to any one of a set of representations, each with its own specific location.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -