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

📄 cookie.html

📁 j2ee api,很好的api。我这现在有
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/http/Cookie.html#setDomain(java.lang.String)">setDomain</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;pattern)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the domain within which this cookie should be presented. </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/Cookie.html#setMaxAge(int)">setMaxAge</A></B>(int&nbsp;expiry)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the maximum age of the cookie in seconds. </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/Cookie.html#setPath(java.lang.String)">setPath</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;uri)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies a path for the cookie to which the client should return the cookie. </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/Cookie.html#setSecure(boolean)">setSecure</A></B>(boolean&nbsp;flag)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL. </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/Cookie.html#setValue(java.lang.String)">setValue</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Assigns a new value to a cookie after the cookie is created. </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/Cookie.html#setVersion(int)">setVersion</A></B>(int&nbsp;v)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the version of the cookie protocol this cookie complies with. </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#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="Cookie(java.lang.String, java.lang.String)"><!-- --></A><H3>Cookie</H3><PRE>public <B>Cookie</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name,              <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;value)</PRE><DL><DD>Constructs a cookie with a specified name and value. <p>The name must conform to RFC 2109. That means it can contain  only ASCII alphanumeric characters and cannot contain commas,  semicolons, or white space or begin with a $ character. The cookie's name cannot be changed after creation. <p>The value can be anything the server chooses to send. Its value is probably of interest only to the server. The cookie's value can be changed after creation with the <code>setValue</code> method. <p>By default, cookies are created according to the Netscape cookie specification. The version can be changed with the  <code>setVersion</code> method.<P><DT><B>Parameters:</B><DD><CODE>name</CODE> - a <code>String</code> specifying the name of the cookie<DD><CODE>value</CODE> - a <code>String</code> specifying the value of the cookie<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the cookie name contains illegal characters					(for example, a comma, space, or semicolon)					or it is one of the tokens reserved for use					by the cookie protocol<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#setValue(java.lang.String)"><CODE>setValue(java.lang.String)</CODE></A>, <A HREF="../../../javax/servlet/http/Cookie.html#setVersion(int)"><CODE>setVersion(int)</CODE></A></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="setComment(java.lang.String)"><!-- --></A><H3>setComment</H3><PRE>public void <B>setComment</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;purpose)</PRE><DL><DD>Specifies a comment that describes a cookie's purpose. The comment is useful if the browser presents the cookie  to the user. Comments are not supported by Netscape Version 0 cookies.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>purpose</CODE> - a <code>String</code> specifying the comment 				to display to the user<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#getComment()"><CODE>getComment()</CODE></A></DL></DD></DL><HR><A NAME="getComment()"><!-- --></A><H3>getComment</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getComment</B>()</PRE><DL><DD>Returns the comment describing the purpose of this cookie, or <code>null</code> if the cookie has no comment.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> containing the comment,				or <code>null</code> if none<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#setComment(java.lang.String)"><CODE>setComment(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="setDomain(java.lang.String)"><!-- --></A><H3>setDomain</H3><PRE>public void <B>setDomain</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;pattern)</PRE><DL><DD>Specifies the domain within which this cookie should be presented. <p>The form of the domain name is specified by RFC 2109. A domain name begins with a dot (<code>.foo.com</code>) and means that the cookie is visible to servers in a specified Domain Name System (DNS) zone (for example, <code>www.foo.com</code>, but not  <code>a.b.foo.com</code>). By default, cookies are only returned to the server that sent them.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pattern</CODE> - a <code>String</code> containing the domain name				within which this cookie is visible;				form is according to RFC 2109<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#getDomain()"><CODE>getDomain()</CODE></A></DL></DD></DL><HR><A NAME="getDomain()"><!-- --></A><H3>getDomain</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getDomain</B>()</PRE><DL><DD>Returns the domain name set for this cookie. The form of  the domain name is set by RFC 2109.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> containing the domain name<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#setDomain(java.lang.String)"><CODE>setDomain(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="setMaxAge(int)"><!-- --></A><H3>setMaxAge</H3><PRE>public void <B>setMaxAge</B>(int&nbsp;expiry)</PRE><DL><DD>Sets the maximum age of the cookie in seconds. <p>A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the <i>maximum</i> age when the cookie will expire, not the cookie's current age. <p>A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>expiry</CODE> - an integer specifying the maximum age of the 				cookie in seconds; if negative, means				the cookie is not stored; if zero, deletes				the cookie<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#getMaxAge()"><CODE>getMaxAge()</CODE></A></DL></DD></DL><HR><A NAME="getMaxAge()"><!-- --></A><H3>getMaxAge</H3><PRE>public int <B>getMaxAge</B>()</PRE><DL><DD>Returns the maximum age of the cookie, specified in seconds, By default, <code>-1</code> indicating the cookie will persist until browser shutdown.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an integer specifying the maximum age of the				cookie in seconds; if negative, means				the cookie persists until browser shutdown<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#setMaxAge(int)"><CODE>setMaxAge(int)</CODE></A></DL></DD></DL><HR><A NAME="setPath(java.lang.String)"><!-- --></A><H3>setPath</H3><PRE>public void <B>setPath</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;uri)</PRE><DL><DD>Specifies a path for the cookie to which the client should return the cookie. <p>The cookie is visible to all the pages in the directory

⌨️ 快捷键说明

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