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

📄 cookie.html

📁 j2ee帮助文档软件设计/软件工程 文件格式
💻 HTML
📖 第 1 页 / 共 3 页
字号:
 information on setting path names for cookies.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>uri</CODE> - a <code>String</code> specifying a path<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#getPath()"><CODE>getPath()</CODE></A></DL></DD></DL><HR><A NAME="getPath()"><!-- --></A><H3>getPath</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getPath</B>()</PRE><DL><DD>Returns the path on the server  to which the browser returns this cookie. The cookie is visible to all subpaths on the server.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> specifying a path that contains                        a servlet name, for example, <i>/catalog</i><DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#setPath(java.lang.String)"><CODE>setPath(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="setSecure(boolean)"><!-- --></A><H3>setSecure</H3><PRE>public void <B>setSecure</B>(boolean&nbsp;flag)</PRE><DL><DD>Indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL. <p>The default value is <code>false</code>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>flag</CODE> - if <code>true</code>, sends the cookie from the browser                        to the server only when using a secure protocol;                        if <code>false</code>, sent on any protocol<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#getSecure()"><CODE>getSecure()</CODE></A></DL></DD></DL><HR><A NAME="getSecure()"><!-- --></A><H3>getSecure</H3><PRE>public boolean <B>getSecure</B>()</PRE><DL><DD>Returns <code>true</code> if the browser is sending cookies only over a secure protocol, or <code>false</code> if the browser can send cookies using any protocol.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>true</code> if the browser uses a secure protocol;                         otherwise, <code>true</code><DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#setSecure(boolean)"><CODE>setSecure(boolean)</CODE></A></DL></DD></DL><HR><A NAME="getName()"><!-- --></A><H3>getName</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getName</B>()</PRE><DL><DD>Returns the name of the cookie. The name cannot be changed after creation.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> specifying the cookie's name</DL></DD></DL><HR><A NAME="setValue(java.lang.String)"><!-- --></A><H3>setValue</H3><PRE>public void <B>setValue</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;newValue)</PRE><DL><DD>Assigns a new value to a cookie after the cookie is created. If you use a binary value, you may want to use BASE64 encoding. <p>With Version 0 cookies, values should not contain white  space, brackets, parentheses, equals signs, commas, double quotes, slashes, question marks, at signs, colons, and semicolons. Empty values may not behave the same way on all browsers.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newValue</CODE> - a <code>String</code> specifying the new value<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#getValue()"><CODE>getValue()</CODE></A>, <A HREF="../../../javax/servlet/http/Cookie.html" title="class in javax.servlet.http"><CODE>Cookie</CODE></A></DL></DD></DL><HR><A NAME="getValue()"><!-- --></A><H3>getValue</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getValue</B>()</PRE><DL><DD>Returns the value of the cookie.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> containing the cookie's                                present value<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" title="class in javax.servlet.http"><CODE>Cookie</CODE></A></DL></DD></DL><HR><A NAME="getVersion()"><!-- --></A><H3>getVersion</H3><PRE>public int <B>getVersion</B>()</PRE><DL><DD>Returns the version of the protocol this cookie complies  with. Version 1 complies with RFC 2109,  and version 0 complies with the original cookie specification drafted by Netscape. Cookies provided by a browser use and identify the browser's cookie version.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>0 if the cookie complies with the                                original Netscape specification; 1                                if the cookie complies with RFC 2109<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#setVersion(int)"><CODE>setVersion(int)</CODE></A></DL></DD></DL><HR><A NAME="setVersion(int)"><!-- --></A><H3>setVersion</H3><PRE>public void <B>setVersion</B>(int&nbsp;v)</PRE><DL><DD>Sets the version of the cookie protocol this cookie complies with. Version 0 complies with the original Netscape cookie specification. Version 1 complies with RFC 2109. <p>Since RFC 2109 is still somewhat new, consider version 1 as experimental; do not use it yet on production sites.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - 0 if the cookie should comply with                                 the original Netscape specification;                                1 if the cookie should comply with RFC 2109<DT><B>See Also:</B><DD><A HREF="../../../javax/servlet/http/Cookie.html#getVersion()"><CODE>getVersion()</CODE></A></DL></DD></DL><HR><A NAME="clone()"><!-- --></A><H3>clone</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>clone</B>()</PRE><DL><DD>Overrides the standard <code>java.lang.Object.clone</code>  method to return a copy of this cookie.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></DL></DD><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;PREV CLASS&nbsp;&nbsp;<A HREF="../../../javax/servlet/http/HttpServlet.html" title="class in javax.servlet.http"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?javax/servlet/http/Cookie.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Cookie.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>

⌨️ 快捷键说明

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