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

📄 httpservletresponse.html

📁 java API学习JAVA的人必备之品
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletResponse.html#sendRedirect(java.lang.String)">sendRedirect</A></B>(java.lang.String&nbsp;location)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sends a temporary redirect response to the client using the
 specified redirect location URL.</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/HttpServletResponse.html#setDateHeader(java.lang.String, long)">setDateHeader</A></B>(java.lang.String&nbsp;name,
              long&nbsp;date)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a response header with the given name and
 date-value.</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/HttpServletResponse.html#setHeader(java.lang.String, java.lang.String)">setHeader</A></B>(java.lang.String&nbsp;name,
          java.lang.String&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a response header with the given name and value.</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/HttpServletResponse.html#setIntHeader(java.lang.String, int)">setIntHeader</A></B>(java.lang.String&nbsp;name,
             int&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a response header with the given name and
 integer value.</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/HttpServletResponse.html#setStatus(int)">setStatus</A></B>(int&nbsp;sc)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the status code for this response.</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/HttpServletResponse.html#setStatus(int, java.lang.String)">setStatus</A></B>(int&nbsp;sc,
          java.lang.String&nbsp;sm)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>As of version 2.1, due to ambiguous meaning of the 
 message parameter. To set a status code 
 use <code>setStatus(int)</code>, to send an error with a description
 use <code>sendError(int, String)</code>.

 Sets the status code and message for this response.</I></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.servlet.ServletResponse"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface javax.servlet.<A HREF="../../../javax/servlet/ServletResponse.html" title="interface in javax.servlet">ServletResponse</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/servlet/ServletResponse.html#flushBuffer()">flushBuffer</A>, <A HREF="../../../javax/servlet/ServletResponse.html#getBufferSize()">getBufferSize</A>, <A HREF="../../../javax/servlet/ServletResponse.html#getCharacterEncoding()">getCharacterEncoding</A>, <A HREF="../../../javax/servlet/ServletResponse.html#getContentType()">getContentType</A>, <A HREF="../../../javax/servlet/ServletResponse.html#getLocale()">getLocale</A>, <A HREF="../../../javax/servlet/ServletResponse.html#getOutputStream()">getOutputStream</A>, <A HREF="../../../javax/servlet/ServletResponse.html#getWriter()">getWriter</A>, <A HREF="../../../javax/servlet/ServletResponse.html#isCommitted()">isCommitted</A>, <A HREF="../../../javax/servlet/ServletResponse.html#reset()">reset</A>, <A HREF="../../../javax/servlet/ServletResponse.html#resetBuffer()">resetBuffer</A>, <A HREF="../../../javax/servlet/ServletResponse.html#setBufferSize(int)">setBufferSize</A>, <A HREF="../../../javax/servlet/ServletResponse.html#setCharacterEncoding(java.lang.String)">setCharacterEncoding</A>, <A HREF="../../../javax/servlet/ServletResponse.html#setContentLength(int)">setContentLength</A>, <A HREF="../../../javax/servlet/ServletResponse.html#setContentType(java.lang.String)">setContentType</A>, <A HREF="../../../javax/servlet/ServletResponse.html#setLocale(java.util.Locale)">setLocale</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="SC_CONTINUE"><!-- --></A><H3>
SC_CONTINUE</H3>
<PRE>
public static final int <B>SC_CONTINUE</B></PRE>
<DL>
<DD>Status code (100) indicating the client can continue.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_CONTINUE">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_SWITCHING_PROTOCOLS"><!-- --></A><H3>
SC_SWITCHING_PROTOCOLS</H3>
<PRE>
public static final int <B>SC_SWITCHING_PROTOCOLS</B></PRE>
<DL>
<DD>Status code (101) indicating the server is switching protocols
 according to Upgrade header.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_SWITCHING_PROTOCOLS">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_OK"><!-- --></A><H3>
SC_OK</H3>
<PRE>
public static final int <B>SC_OK</B></PRE>
<DL>
<DD>Status code (200) indicating the request succeeded normally.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_OK">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_CREATED"><!-- --></A><H3>
SC_CREATED</H3>
<PRE>
public static final int <B>SC_CREATED</B></PRE>
<DL>
<DD>Status code (201) indicating the request succeeded and created
 a new resource on the server.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_CREATED">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_ACCEPTED"><!-- --></A><H3>
SC_ACCEPTED</H3>
<PRE>
public static final int <B>SC_ACCEPTED</B></PRE>
<DL>
<DD>Status code (202) indicating that a request was accepted for
 processing, but was not completed.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_ACCEPTED">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_NON_AUTHORITATIVE_INFORMATION"><!-- --></A><H3>
SC_NON_AUTHORITATIVE_INFORMATION</H3>
<PRE>
public static final int <B>SC_NON_AUTHORITATIVE_INFORMATION</B></PRE>
<DL>
<DD>Status code (203) indicating that the meta information presented
 by the client did not originate from the server.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_NON_AUTHORITATIVE_INFORMATION">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_NO_CONTENT"><!-- --></A><H3>
SC_NO_CONTENT</H3>
<PRE>
public static final int <B>SC_NO_CONTENT</B></PRE>
<DL>
<DD>Status code (204) indicating that the request succeeded but that
 there was no new information to return.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_NO_CONTENT">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_RESET_CONTENT"><!-- --></A><H3>
SC_RESET_CONTENT</H3>
<PRE>
public static final int <B>SC_RESET_CONTENT</B></PRE>
<DL>
<DD>Status code (205) indicating that the agent <em>SHOULD</em> reset
 the document view which caused the request to be sent.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_RESET_CONTENT">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_PARTIAL_CONTENT"><!-- --></A><H3>
SC_PARTIAL_CONTENT</H3>
<PRE>
public static final int <B>SC_PARTIAL_CONTENT</B></PRE>
<DL>
<DD>Status code (206) indicating that the server has fulfilled
 the partial GET request for the resource.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_PARTIAL_CONTENT">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_MULTIPLE_CHOICES"><!-- --></A><H3>
SC_MULTIPLE_CHOICES</H3>
<PRE>
public static final int <B>SC_MULTIPLE_CHOICES</B></PRE>
<DL>
<DD>Status code (300) indicating that the requested resource
 corresponds to any one of a set of representations, each with
 its own specific location.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_MULTIPLE_CHOICES">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_MOVED_PERMANENTLY"><!-- --></A><H3>
SC_MOVED_PERMANENTLY</H3>
<PRE>
public static final int <B>SC_MOVED_PERMANENTLY</B></PRE>
<DL>
<DD>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.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_MOVED_TEMPORARILY"><!-- --></A><H3>
SC_MOVED_TEMPORARILY</H3>
<PRE>
public static final int <B>SC_MOVED_TEMPORARILY</B></PRE>
<DL>
<DD>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.

 This definition is being retained for backwards compatibility.
 SC_FOUND is now the preferred definition.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_MOVED_TEMPORARILY">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_FOUND"><!-- --></A><H3>
SC_FOUND</H3>
<PRE>
public static final int <B>SC_FOUND</B></PRE>
<DL>
<DD>Status code (302) indicating that the resource reside
 temporarily under a different URI. Since the redirection might
 be altered on occasion, the client should continue to use the
 Request-URI for future requests.(HTTP/1.1) To represent the
 status code (302), it is recommended to use this variable.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_FOUND">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_SEE_OTHER"><!-- --></A><H3>
SC_SEE_OTHER</H3>
<PRE>
public static final int <B>SC_SEE_OTHER</B></PRE>
<DL>
<DD>Status code (303) indicating that the response to the request
 can be found under a different URI.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_SEE_OTHER">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_NOT_MODIFIED"><!-- --></A><H3>
SC_NOT_MODIFIED</H3>
<PRE>
public static final int <B>SC_NOT_MODIFIED</B></PRE>
<DL>
<DD>Status code (304) indicating that a conditional GET operation
 found that the resource was available and not modified.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_USE_PROXY"><!-- --></A><H3>
SC_USE_PROXY</H3>
<PRE>
public static final int <B>SC_USE_PROXY</B></PRE>
<DL>
<DD>Status code (305) indicating that the requested resource
 <em>MUST</em> be accessed through the proxy given by the
 <code><em>Location</em></code> field.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_USE_PROXY">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="SC_TEMPORARY_REDIRECT"><!-- --></A><H3>
SC_TEMPORARY_REDIRECT</H3>
<PRE>
public static final int <B>SC_TEMPORARY_REDIRECT</B></PRE>
<DL>
<DD>Status code (307) indicating that the requested resource 
 resides temporarily under a different URI. The temporary URI
 <em>SHOULD</em> be given by the <code><em>Location</em></code> 
 field in the response.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.servlet.http.HttpServletResponse.SC_TEMPORARY_REDIRECT">Constant Field Values</A></DL>
</DL>
<HR>

⌨️ 快捷键说明

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