﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-笑着生活-随笔分类-JSP</title><link>http://www.blogjava.net/yzzh9/category/35366.html</link><description>思想大于技术......
惟仁者为能以大事小,惟智者为能以小事大：
Java之路——专注，研究，思考，总结
</description><language>zh-cn</language><lastBuildDate>Tue, 09 Jun 2009 05:45:21 GMT</lastBuildDate><pubDate>Tue, 09 Jun 2009 05:45:21 GMT</pubDate><ttl>60</ttl><item><title>forward、sendRedirect及Jsp和Servlet之间的跳转</title><link>http://www.blogjava.net/yzzh9/archive/2009/06/09/280908.html</link><dc:creator>999</dc:creator><author>999</author><pubDate>Tue, 09 Jun 2009 05:41:00 GMT</pubDate><guid>http://www.blogjava.net/yzzh9/archive/2009/06/09/280908.html</guid><wfw:comment>http://www.blogjava.net/yzzh9/comments/280908.html</wfw:comment><comments>http://www.blogjava.net/yzzh9/archive/2009/06/09/280908.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yzzh9/comments/commentRss/280908.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yzzh9/services/trackbacks/280908.html</trackback:ping><description><![CDATA[
		<div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">&lt;jsp:forward&gt;</span>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">使用同一个</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">request</span>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">，是在服务器端跳转，浏览器显示的是第一个页面的名字，因为客户端（浏览器）不知道它在服务器端跳转了。</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p>
						</o:p>
				</span>
		</div>
		<div>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" courier="" new?;="" ?times="" 宋体;="" mso-fareast-font-family:="">Response.sendRedirect</span>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">是两个不同的</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" courier="" new?;="" ?times="" 宋体;="" mso-fareast-font-family:="">request</span>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">，是在客户端跳转，浏览器显示的是跳转后的页面的名字。因为它是从客户端跳转到第二个页面的。</span>
		</div>
		<div>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">
				</span> </div>
		<div>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">
						<img onclick="window.open(this.src)" alt="" src="http://blog.51cto.com/attachment/200906/200906091244525332718.jpg" border="0" />
				</span>
		</div>
		<div>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">
				</span> </div>
		<div>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">
						<img onclick="window.open(this.src)" alt="" src="http://blog.51cto.com/attachment/200906/200906091244525370718.jpg" border="0" />
				</span>
		</div>
		<div>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">
				</span> </div>
		<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">
				<div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt">
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">使用</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">forward</span>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">时，由于只是发送一次</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">request</span>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">请求，</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">request</span>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">设置的属性（</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">setAttribute</span>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">）依然能保留在下一个页面。</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">
								<o:p>
								</o:p>
						</span>
				</div>
				<div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt">
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">使用</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">sendRedirect</span>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">时，由于发送两次</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">request</span>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">请求，所以在下一个不能获取</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">request</span>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">属性。但可以通过重写</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">URL</span>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">的方式将内容传递过去。</span>
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">
								<o:p>
								</o:p>
						</span>
				</div>
				<div>
						<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">下面举例说明：</span>
				</div>
				<span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:="">
						<div>
								<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee">
										<img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />tian.jsp    <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;%request.setAttribute(<font color="#800000">"river"</font>,<font color="#800000">"redwater"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />    request.setAttribute(<font color="#800000">"country"</font>,<font color="#800000">"daguaiwan"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />%&gt; <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;jsp:forward page=<font color="#800000">"fengshan.jsp"</font> /&gt; <br /></div>
						</div>
						<div> </div>
						<div>
						</div>
				</span> <div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee"><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />donglan.jsp    <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;%request.setAttribute(<font color="#800000">"river"</font>,<font color="#800000">"redwater"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />    request.setAttribute(<font color="#800000">"country"</font>,<font color="#800000">"daguaiwan"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />%&gt; <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;a href=<font color="#800000">"fengshan.jsp"</font>&gt;fengshan&lt;/a&gt; <br /></div></div><div><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:=""></span> </div><div><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:=""></span> </div><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:=""><div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee"><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />bama.jsp    <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;%request.setAttribute(<font color="#800000">"river"</font>,<font color="#800000">"redwater"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />    request.setAttribute(<font color="#800000">"country"</font>,<font color="#800000">"daguaiwan"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />    response.sendRedirect(<font color="#800000">"fengshan.jsp"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />%&gt; <br /></div></div><div> </div><div> </div><div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee"><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />fengshan.jsp <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;%=request.getAttribute(<font color="#800000">"river"</font>)%&gt;&lt;br/&gt; <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;%=request.getAttribute(<font color="#800000">"country"</font>)%&gt; <br /></div></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US"><a href="http://localhost:8080/ForwardRedirect/tiane.jsp"><font face="Times New Roman" size="3">http://localhost:8080/ForwardRedirect/tiane.jsp</font></a><font face="Times New Roman" size="3"></font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: " times="" new="" roman?;="" ?times="" roman??="" mso-hansi-font-family:=""><font size="3">跳转后结果为：</font></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><font size="3"><font face="Times New Roman"><span lang="EN-US" style="BACKGROUND: black; COLOR: white; mso-highlight: black">redwater<br />daguaiwan</span><span lang="EN-US" style="COLOR: white"><o:p></o:p></span></font></font></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US" style="COLOR: white"><o:p><font face="Times New Roman" size="3"> </font></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US"><a href="http://localhost:8080/ForwardRedirect/donglan.jsp"><font face="Times New Roman" size="3">http://localhost:8080/ForwardRedirect/donglan.jsp</font></a><font face="Times New Roman" size="3"></font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: " times="" new="" roman?;="" ?times="" roman??="" mso-hansi-font-family:=""><font size="3">跳转后结果为：</font></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><font size="3"><font face="Times New Roman"><span lang="EN-US" style="BACKGROUND: black; COLOR: white; mso-highlight: black">null<br />null</span><span lang="EN-US" style="COLOR: white"><o:p></o:p></span></font></font></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3"> </font></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US"><a href="http://localhost:8080/ForwardRedirect/bama.jsp"><font face="Times New Roman" size="3">http://localhost:8080/ForwardRedirect/bama.jsp</font></a><font face="Times New Roman" size="3"></font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: " times="" new="" roman?;="" ?times="" roman??="" mso-hansi-font-family:=""><font size="3">跳转后结果为：</font></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><font size="3"><font face="Times New Roman"><span lang="EN-US" style="BACKGROUND: black; COLOR: white; mso-highlight: black">null<br />null</span><span lang="EN-US" style="COLOR: white"><o:p></o:p></span></font></font></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3"> </font></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">结果分析：</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""><o:p></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">tiane.jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">是通过</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">forward</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">跳转到</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">fengshan.jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">的，这两个页面享用的是同一个</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">request</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">，故</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">fengshan.jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">可以接收到</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">tiane.jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">通过</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""> request</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">设置的属性。</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""><o:p></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">而</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">donglan.jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">是通过</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">href</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">发送了另外的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">request</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">请求，</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">bama.jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">是通过</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">sendRedirect</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">跳转，用的也是另外的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">request</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">请求，故</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">fengshan.jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">不可以接收到这两个页面通过</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""> request</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">设置的属性。</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""><o:p></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""><o:p> </o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">Jsp</span><span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">和</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">Servlet</span><span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">之间的跳转：</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""><o:p></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">从</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">Jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">跳转</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">Servlet</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">可以使用</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">&lt;jsp:forward page=”URL” /&gt;</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">或者</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">response.sendRedirect(URL)</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">都可以，它们之间的区别上面已经说明了。</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""><o:p></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""><o:p> </o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1; tab-stops: 105.75pt"><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">从</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">Servlet</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">跳转</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?="">Jsp</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: ; mso-font-kerning: 0pt" new="" courier="" new?;="" ?times="" roman??="" mso-hansi-font-family:="">：</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-bidi-font-size:="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" new="" roman?;="" courier="" new?;="" ?times="" 0pt?=""><o:p></o:p></span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-outline-level: 1; tab-stops: list 21.0pt left 95.5pt; mso-list: l0 level1 lfo1"><span lang="EN-US" style="FONT-FAMILY: wingdings; mso-bidi-font-family: wingdings; mso-fareast-font-family: wingdings"><span style="mso-list: ignore"><font size="3">²</font><span style="FONT-WEIGHT: normal; FONT-SIZE: 7pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal" times="" new="" roman??="">        </span></span></span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-font-kerning:="" courier="" new?;="" 0pt?="">getRequestDispatcher</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-family: " mso-font-kerning:="" courier="" new?;="" ?courier="" new??="" mso-hansi-font-family:="" mso-ascii-font-family:="" 0pt;="">的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-font-kerning:="" courier="" new?;="" 0pt?="">forward(request, response)</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-family: " mso-font-kerning:="" courier="" new?;="" ?courier="" new??="" mso-hansi-font-family:="" mso-ascii-font-family:="" 0pt;="">方法，这里也只是发送了一次请求，可以在下一个页面接受</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-font-kerning:="" courier="" new?;="" 0pt?="">request</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-family: " mso-font-kerning:="" courier="" new?;="" ?courier="" new??="" mso-hansi-font-family:="" mso-ascii-font-family:="" 0pt;="">设置的属性。</span></div><div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-outline-level: 1; tab-stops: list 21.0pt left 95.5pt; mso-list: l0 level1 lfo1"><span lang="EN-US" style="FONT-FAMILY: wingdings; mso-bidi-font-family: wingdings; mso-fareast-font-family: wingdings"><span style="mso-list: ignore"><font size="3">²</font><span style="FONT-WEIGHT: normal; FONT-SIZE: 7pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal" times="" new="" roman??="">        </span></span></span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-font-kerning:="" courier="" new?;="" 0pt?="">response.sendRedirect(URL),</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-family: " mso-font-kerning:="" courier="" new?;="" ?courier="" new??="" mso-hansi-font-family:="" mso-ascii-font-family:="" 0pt;="">这里发送了两次请求，不可以在下一个页面接受</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " mso-font-kerning:="" courier="" new?;="" 0pt?="">request</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-family: " mso-font-kerning:="" courier="" new?;="" ?courier="" new??="" mso-hansi-font-family:="" mso-ascii-font-family:="" 0pt;="">设置的属性。</span></div><div><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" en-us;="" zh-cn;="" ar-sa?="" courier="" new?;="" ?courier="" mso-hansi-font-family:="" mso-ascii-font-family:="">例子如下：</span></div><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" en-us;="" zh-cn;="" ar-sa?="" courier="" new?;="" ?courier="" mso-hansi-font-family:="" mso-ascii-font-family:=""><div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee"><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />servlettiane.jsp    <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;%request.setAttribute(<font color="#800000">"river"</font>,<font color="#800000">"redwater"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />    request.setAttribute(<font color="#800000">"country"</font>,<font color="#800000">"daguaiwan"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />%&gt; <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;jsp:forward page=<font color="#800000">"/tiane"</font> /&gt; <br /></div></div><div> </div><div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee"><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />servletbama.jsp    <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />&lt;%request.setAttribute(<font color="#800000">"river"</font>,<font color="#800000">"redwater"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />    request.setAttribute(<font color="#800000">"country"</font>,<font color="#800000">"daguaiwan"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />    response.sendRedirect(<font color="#800000">"/ForwardRedirect/tiane"</font>); <br /><img onclick="window.open(this.src)" src="http://blog.51cto.com/images/editer/InBlock.gif" align="top" />%&gt; <br /></div></div><div> </div><div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee">Tiane.java <br /><font color="#0000ff">public</font><font color="#0000ff">class</font> Tiane <font color="#0000ff">extends</font> HttpServlet { <br /><br />  <font color="#0000ff">public</font><font color="#0000ff">void</font> doGet(HttpServletRequest request, HttpServletResponse response) <br />      <font color="#0000ff">throws</font> ServletException, IOException { <br /><font color="#008000">//    response.sendRedirect("/ForwardRedirect/fengshan.jsp"); </font><br />    <font color="#0000ff">this</font>.getServletConfig().getServletContext() <br />            .getRequestDispatcher(<font color="#800000">"/fengshan.jsp"</font>).forward(request, response); <br />  } <br /><br />  <font color="#0000ff">public</font><font color="#0000ff">void</font> doPost(HttpServletRequest request, HttpServletResponse response) <br />      <font color="#0000ff">throws</font> ServletException, IOException { <br />    doGet(request, response); <br />  }    <br />} <br /></div></div><div> </div><div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee">再在web.xml中配置servlet： <br />  <font color="#0000ff">&lt;</font><font color="#800000">servlet</font><font color="#0000ff">&gt;</font><br />  <font color="#0000ff">&lt;</font><font color="#800000">servlet-name</font><font color="#0000ff">&gt;</font>tiane<font color="#0000ff">&lt;/</font><font color="#800000">servlet-name</font><font color="#0000ff">&gt;</font><br />  <font color="#0000ff">&lt;</font><font color="#800000">servlet-class</font><font color="#0000ff">&gt;</font>com.dvnchina.test.Tiane<font color="#0000ff">&lt;/</font><font color="#800000">servlet-class</font><font color="#0000ff">&gt;</font><br />  <font color="#0000ff">&lt;/</font><font color="#800000">servlet</font><font color="#0000ff">&gt;</font><br />  <font color="#0000ff">&lt;</font><font color="#800000">servlet-mapping</font><font color="#0000ff">&gt;</font><br />  <font color="#0000ff">&lt;</font><font color="#800000">servlet-name</font><font color="#0000ff">&gt;</font>tiane<font color="#0000ff">&lt;/</font><font color="#800000">servlet-name</font><font color="#0000ff">&gt;</font><br />  <font color="#0000ff">&lt;</font><font color="#800000">url-pattern</font><font color="#0000ff">&gt;</font>/tiane<font color="#0000ff">&lt;/</font><font color="#800000">url-pattern</font><font color="#0000ff">&gt;</font><br /><font color="#0000ff">&lt;/</font><font color="#800000">servlet-mapping</font><font color="#0000ff">&gt;</font><br /></div></div><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" en-us;="" zh-cn;="" ar-sa?="" courier="" new?;="" ?courier="" mso-hansi-font-family:="" mso-ascii-font-family:="">具体的结果我就不分析了，和第一个例子差不多的。代码见附件。</span><div></div></span> <div></div></span></span> <div><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: " mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" new?;="" ?courier="" ?times="" mso-hansi-font-family:="" mso-ascii-font-family:=""></span> </div><br /><img src ="http://www.blogjava.net/yzzh9/aggbug/280908.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yzzh9/" target="_blank">999</a> 2009-06-09 13:41 <a href="http://www.blogjava.net/yzzh9/archive/2009/06/09/280908.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Jsp&amp;Servlet之Session对象</title><link>http://www.blogjava.net/yzzh9/archive/2009/06/09/280909.html</link><dc:creator>999</dc:creator><author>999</author><pubDate>Tue, 09 Jun 2009 05:41:00 GMT</pubDate><guid>http://www.blogjava.net/yzzh9/archive/2009/06/09/280909.html</guid><wfw:comment>http://www.blogjava.net/yzzh9/comments/280909.html</wfw:comment><comments>http://www.blogjava.net/yzzh9/archive/2009/06/09/280909.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yzzh9/comments/commentRss/280909.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yzzh9/services/trackbacks/280909.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 声明：此篇文章为从网上下载的doc文档中的摘取，彩色部分为本人的笔记。																																																		 																				u																																						session						...&nbsp;&nbsp;<a href='http://www.blogjava.net/yzzh9/archive/2009/06/09/280909.html'>阅读全文</a><img src ="http://www.blogjava.net/yzzh9/aggbug/280909.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yzzh9/" target="_blank">999</a> 2009-06-09 13:41 <a href="http://www.blogjava.net/yzzh9/archive/2009/06/09/280909.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Jsp&amp;Servlet之Cookie</title><link>http://www.blogjava.net/yzzh9/archive/2009/06/09/280910.html</link><dc:creator>999</dc:creator><author>999</author><pubDate>Tue, 09 Jun 2009 05:41:00 GMT</pubDate><guid>http://www.blogjava.net/yzzh9/archive/2009/06/09/280910.html</guid><wfw:comment>http://www.blogjava.net/yzzh9/comments/280910.html</wfw:comment><comments>http://www.blogjava.net/yzzh9/archive/2009/06/09/280910.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yzzh9/comments/commentRss/280910.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yzzh9/services/trackbacks/280910.html</trackback:ping><description><![CDATA[
		<div>
				<font face="Verdana" color="#ff6347">声明：此篇文章为我从网上下载的doc文档里面的一部分内容，具体作者不知。</font>
		</div>
		<div> </div>
		<div> </div>
		<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<font size="3">
						<span lang="EN-US">
								<font face="Verdana">Cookie</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">简介：</span>
						<span lang="EN-US">
								<font face="Verdana">Cookie</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">是服务器保存在客户端上的一组数据。例如，一些登陆网站时会提示是否保存密码，或是选择登陆有效期（浏览器进程、一天、一个月等等），这些都可以使用</span>
						<span lang="EN-US">
								<font face="Verdana">Cookie</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">来实现。</span>
				</font>
		</div>
		<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p>
								<font face="Verdana" size="3"> </font>
						</o:p>
				</span>
		</div>
		<div>
				<table class="MsoTableGrid" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing="0" cellpadding="0" border="1">
						<tbody>
								<tr style="HEIGHT: 22.7pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes">
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 22.7pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" width="151">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<span lang="EN-US">
																<font face="Verdana">Cookie</font>
														</span>
														<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">类</span>
												</div>
										</td>
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ffffff; WIDTH: 312.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 22.7pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" width="417">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<span lang="EN-US">
																<font face="Verdana">javax.servlet.http.Cookie</font>
														</span>
												</div>
										</td>
								</tr>
								<tr style="HEIGHT: 22.7pt; mso-yfti-irow: 1">
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ffffff; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 22.7pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" width="151">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">构造方法</span>
												</div>
										</td>
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ffffff; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ffffff; WIDTH: 312.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 22.7pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" width="417">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<span lang="EN-US">
																<font face="Verdana">Cookie(String name,String value)</font>
														</span>
												</div>
										</td>
								</tr>
								<tr style="HEIGHT: 45.75pt; mso-yfti-irow: 2">
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ffffff; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 45.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" width="151">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">服务器<span style="COLOR: fuchsia">向</span>客户端设置</span>
														<span lang="EN-US">
																<font face="Verdana">cookie</font>
														</span>
												</div>
										</td>
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ffffff; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ffffff; WIDTH: 312.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 45.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" width="417">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<b style="mso-bidi-font-weight: normal">
																<span lang="EN-US">
																		<font face="Verdana">addCookie(Cookie cookie)<o:p></o:p></font>
																</span>
														</b>
												</div>
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<b style="mso-bidi-font-weight: normal">
																<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">由</span>
																<span lang="EN-US" style="COLOR: fuchsia">
																		<font face="Verdana">response</font>
																</span>
														</b>
														<b style="mso-bidi-font-weight: normal">
																<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">调用，</span>
														</b>
														<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">可反复使用该方法设置多个</span>
														<span lang="EN-US">
																<font face="Verdana">Cookie</font>
														</span>
												</div>
										</td>
								</tr>
								<tr style="HEIGHT: 47.7pt; mso-yfti-irow: 3">
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ffffff; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 47.7pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" width="151">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">服务器<span style="COLOR: fuchsia">从</span>客户端取回之前保留在客户端上的</span>
														<span lang="EN-US">
																<font face="Verdana">cookie</font>
														</span>
												</div>
										</td>
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ffffff; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ffffff; WIDTH: 312.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 47.7pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" width="417">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<font face="Verdana">
																<b style="mso-bidi-font-weight: normal">
																		<span lang="EN-US">Cookie[]</span>
																</b>
																<span lang="EN-US">
																		<b style="mso-bidi-font-weight: normal">getCookies()<o:p></o:p></b>
																</span>
														</font>
												</div>
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<b style="mso-bidi-font-weight: normal">
																<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">由</span>
																<span lang="EN-US" style="COLOR: fuchsia">
																		<font face="Verdana">request</font>
																</span>
														</b>
														<b style="mso-bidi-font-weight: normal">
																<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">调用</span>
														</b>
												</div>
										</td>
								</tr>
								<tr style="HEIGHT: 47.7pt; mso-yfti-irow: 4; mso-yfti-lastrow: yes">
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ffffff; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 47.7pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" width="151">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">设置</span>
														<span lang="EN-US">
																<font face="Verdana">cookie</font>
														</span>
														<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">在本地留存的时间</span>
												</div>
										</td>
										<td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ffffff; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ffffff; WIDTH: 312.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 47.7pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" width="417">
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<font face="Verdana">
																<b>
																		<span lang="EN-US">setMaxAge</span>
																</b>
																<b style="mso-bidi-font-weight: normal">
																		<span lang="EN-US">(int expiry)<o:p></o:p></span>
																</b>
														</font>
												</div>
												<div class="a" style="MARGIN: 0cm 0cm 0pt">
														<b style="mso-bidi-font-weight: normal">
																<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">由</span>
																<span lang="EN-US">
																		<font face="Verdana">cookie</font>
																</span>
														</b>
														<b style="mso-bidi-font-weight: normal">
																<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">对象调用</span>
																<span lang="EN-US">
																		<o:p>
																		</o:p>
																</span>
														</b>
												</div>
										</td>
								</tr>
						</tbody>
				</table>
		</div>
		<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<o:p>
								<font face="Verdana" size="3"> </font>
						</o:p>
				</span>
		</div>
		<div class="2" style="MARGIN: 2pt 0cm 2pt 21pt; TEXT-INDENT: -21pt; tab-stops: list 21.0pt; mso-list: l1 level1 lfo2">
				<span lang="EN-US" style="FONT-WEIGHT: normal; FONT-FAMILY: wingdings; mso-bidi-font-family: wingdings; mso-fareast-font-family: wingdings; mso-bidi-font-weight: bold">
						<span style="mso-list: ignore">
								<font size="3">l</font>
						</span>
				</span>
				<strong>
						<font size="3">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">示例：设置</span>
								<span lang="EN-US">
										<font face="Verdana">Cookie</font>
								</span>
						</font>
				</strong>
		</div>
		<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<font size="3">
						<span lang="EN-US">
								<font face="Verdana">cookie01.jsp </font>
						</span>
						<span lang="EN-US" style="FONT-FAMILY: wingdings; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana; mso-char-type: symbol; mso-symbol-font-family: wingdings">
								<span style="mso-char-type: symbol; mso-symbol-font-family: wingdings">à</span>
						</span>
						<span lang="EN-US">
								<font face="Verdana">
								</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">服务器响应客户的请求时，设置</span>
						<span lang="EN-US">
								<font face="Verdana">cookie</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">到客户端：</span>
				</font>
		</div>
		<div class="a" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1">
				<span lang="EN-US" style="FONT-FAMILY: wingdings; mso-bidi-font-family: wingdings; mso-fareast-font-family: wingdings">
						<span style="mso-list: ignore">
								<font size="3">²</font>
						</span>
				</span>
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">先准备好</span>
						<span lang="EN-US">
								<font face="Verdana">cookie</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">对象</span>
				</font>
		</div>
		<div>
				<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">然后利用</span>
				<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:=""> response.addCookie(Cookie cookie)</span>
				<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">进行设置</span>
		</div>
		<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">
				<div>
						<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee">&lt;%    <br />          <font color="#008000">//构造Cookie对象，构造方法：Cookie(String name,String value) </font><br />          Cookie c1= <font color="#0000ff">new</font> Cookie(<font color="#800000">"name"</font>,<font color="#800000">"Jerry"</font>); <br />          Cookie c2= <font color="#0000ff">new</font> Cookie(<font color="#800000">"password"</font>,<font color="#800000">"1234"</font>); <br />          Cookie c3= <font color="#0000ff">new</font> Cookie(<font color="#800000">"access_time"</font>,<font color="#0000ff">new</font> Date().toString()); <br />            <br />          <font color="#008000">//将Cookie设置给客户端 </font><br />          <font color="#008000">//服务器向客户端传递数据，使用response对象 </font><br />          <font color="#008000">//方法：reponse.addCookie(Cookie cookie) </font><br />            <br />          response.addCookie(c1); <br />          response.addCookie(c2); <br />          response.addCookie(c3); <br />%&gt; <br /></div>
				</div>
				<div> </div>
				<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">【注】浏览器窗口中看不到</span>
						<span lang="EN-US">
								<font face="Verdana">Cookie</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">的信息</span>
				</div>
				<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
						<span lang="EN-US">
								<o:p>
										<font face="Verdana"> </font>
								</o:p>
						</span>
				</div>
				<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
						<span lang="EN-US">
								<font face="Verdana">Cookie02.jsp </font>
						</span>
						<span lang="EN-US" style="FONT-FAMILY: wingdings; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana; mso-char-type: symbol; mso-symbol-font-family: wingdings">
								<span style="mso-char-type: symbol; mso-symbol-font-family: wingdings">à</span>
						</span>
						<span lang="EN-US">
								<font face="Verdana">
								</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">如果需要，服务器可以从客户端取回</span>
						<span lang="EN-US">
								<font face="Verdana">cookie</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">，这是<span style="COLOR: fuchsia">从客户端传数据到服务器</span>，故要使用</span>
						<span lang="EN-US">
								<font face="Verdana">request</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">的方法：</span>
						<font face="Verdana">
								<b style="mso-bidi-font-weight: normal">
										<span lang="EN-US">Cookie[]</span>
								</b>
								<span lang="EN-US">
										<b style="mso-bidi-font-weight: normal">request.getCookies()</b>
								</span>
						</font>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">。</span>
				</div>
				<div class="a" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1">
						<span lang="EN-US" style="FONT-FAMILY: wingdings; mso-bidi-font-family: wingdings; mso-fareast-font-family: wingdings">
								<span style="mso-list: ignore">²</span>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">利用</span>
						<span lang="EN-US">
								<font face="Verdana">request.getCookies()</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">取得</span>
						<span lang="EN-US">
								<font face="Verdana">cookie</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">数组</span>
				</div>
				<div>
						<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">遍历数组，取得其中每一个</span>
						<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">cookie</span>
				</div>
				<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">
						<div>
								<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee">&lt;% <br />          <font color="#008000">//Cookie[] request.getCookies()方法 </font><br />          Cookie[] cs = request.getCookies(); <br />            <br />          <font color="#0000ff">for</font>(<font color="#0000ff">int</font> i=0;i&lt;cs.length;i++){             <br />            Cookie tmp = cs[i];     <br />            <font color="#008000">//每一个Cookie由 name--value构成 </font><br />            <font color="#008000">//可以使用 String getName() 和 String getValue() 获得各成分的值 </font><br />                     <br />        %&gt;    <br />            <br />          &lt;h1&gt; &lt;%= tmp.getName() %&gt; &lt;%=tmp.getValue() %&gt; &lt;/h1&gt; <br />        &lt;%    <br />          }        <br />            <br />          <font color="#008000">//JSESSIONID ACCE027387AADBD63525E4446F1DFD83是服务器自动设置的 </font><br />          <font color="#008000">//代表这个客户端在服务器上的一个唯一编号 </font><br />%&gt; <br /></div>
						</div>
						<div> </div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">【注】：每一个</span>
								<span lang="EN-US">
										<font face="Verdana">cookie</font>
								</span>
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">都是由</span>
								<span lang="EN-US">
										<font face="Verdana"> name – value</font>
								</span>
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">构成（由构造方法可知），</span>
								<span lang="EN-US">
										<font face="Verdana">Cookie</font>
								</span>
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">类提供了如下</span>
								<span lang="EN-US">
										<font face="Verdana">2</font>
								</span>
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">个方法获取</span>
								<span lang="EN-US">
										<font face="Verdana">cookie</font>
								</span>
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">的</span>
								<span lang="EN-US">
										<font face="Verdana">name</font>
								</span>
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">和</span>
								<span lang="EN-US">
										<font face="Verdana">value</font>
								</span>
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">的值：</span>
						</div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
								<b style="mso-bidi-font-weight: normal">
										<span lang="EN-US">
												<font face="Verdana">String getName()<o:p></o:p></font>
										</span>
								</b>
						</div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
								<b style="mso-bidi-font-weight: normal">
										<span lang="EN-US">
												<font face="Verdana">String getValue()</font>
										</span>
								</b>
						</div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
								<span lang="EN-US">
										<o:p>
												<font face="Verdana"> </font>
										</o:p>
								</span>
						</div>
						<div class="2" style="MARGIN: 2pt 0cm 2pt 21pt; TEXT-INDENT: -21pt; tab-stops: list 21.0pt; mso-list: l1 level1 lfo1">
								<span lang="EN-US" style="FONT-WEIGHT: normal; FONT-FAMILY: wingdings; mso-bidi-font-family: wingdings; mso-fareast-font-family: wingdings; mso-bidi-font-weight: bold">
										<span style="mso-list: ignore">l</span>
								</span>
								<strong>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">设置</span>
										<span lang="EN-US">
												<font face="Verdana">Cookie</font>
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">的保存时间</span>
								</strong>
						</div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo2">
								<a name="OLE_LINK1">
										<font face="Verdana">
												<span lang="EN-US" style="FONT-FAMILY: wingdings; mso-bidi-font-family: wingdings; mso-fareast-font-family: wingdings">
														<span style="mso-list: ignore">²</span>
												</span>
												<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">默认情况</span>
										</font>
								</a>
								<font face="Verdana">
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">下：</span>
										<span lang="EN-US">cookie</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">是仅在浏览器进程中有效。</span>
								</font>
						</div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt 21pt">
								<font face="Verdana">
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">（在一个窗口中先运行</span>
										<span lang="EN-US"> cookie01.jsp</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">实现设置</span>
										<span lang="EN-US">cookie</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">，然后仍然在这个窗口中运行</span>
										<span lang="EN-US"> cookie02.jsp </span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">取回</span>
										<span lang="EN-US">cookie </span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">并显示</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">是可以实现。但，如果在另外的浏览器窗口中直接运行</span>
										<span lang="EN-US"> cookie02.jsp </span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">，则无法再取回之前设置的</span>
										<span lang="EN-US">cookie</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">了）</span>
								</font>
						</div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt 21pt">
								<span lang="EN-US">
										<o:p>
												<font face="Verdana"> </font>
										</o:p>
								</span>
						</div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo2">
								<font face="Verdana">
										<span lang="EN-US" style="FONT-FAMILY: wingdings; mso-bidi-font-family: wingdings; mso-fareast-font-family: wingdings">
												<span style="mso-list: ignore">²</span>
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">如果希望</span>
										<span lang="EN-US">cookie</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">能在本地留存一段时间，使得在一段时间之内都可以取回</span>
										<span lang="EN-US">cookie</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">，则可以利用</span>
										<span lang="EN-US">Cookie</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">类的</span>
										<b style="mso-bidi-font-weight: normal">
												<span lang="EN-US">setMaxAge(int expiry)</span>
										</b>
										<span lang="EN-US">
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">方法，</span>
										<span lang="EN-US">expiry</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">表多少秒后</span>
										<span lang="EN-US">cookie</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">过期。</span>
								</font>
						</div>
						<div class="a" style="MARGIN: 0cm 0cm 0pt 21pt">
								<span lang="EN-US">
										<o:p>
												<font face="Verdana"> </font>
										</o:p>
								</span>
						</div>
						<div>
								<font face="Verdana">
										<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">修改</span>
										<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">cookie01.jsp </span>
										<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">为</span>
										<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:=""> cookie03.jsp </span>
										<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">，增加</span>
										<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">cookie</span>
										<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">留存时间的设置，仍然使用</span>
										<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">cookie02.jsp</span>
										<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">取回</span>
										<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">cookie</span>
								</font>
						</div>
						<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">
								<div>
										<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; COLOR: #000000; WORD-BREAK: break-all; LINE-HEIGHT: 16px; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; FONT-FAMILY: verdana,宋体; BACKGROUND-COLOR: #eeeeee">&lt;h1&gt;利用Cookie类的setMaxAge(<font color="#0000ff">int</font> expiry)可是设置cookie在本地计算机上留存一段时间，单位是秒&lt;/h1&gt; <br /><br />    &lt;% <br />              <font color="#008000">//构造Cookie对象，构造方法：Cookie(String name,String value) </font><br />              Cookie c1= <font color="#0000ff">new</font> Cookie(<font color="#800000">"name"</font>,<font color="#800000">"Jerry"</font>); <br />              Cookie c2=<font color="#0000ff">new</font> Cookie(<font color="#800000">"password"</font>,<font color="#800000">"1234"</font>); <br />              Cookie c3=<font color="#0000ff">new</font> Cookie(<font color="#800000">"access_time"</font>,<font color="#0000ff">new</font> Date().toString()); <br />                <br />              <font color="#008000">//设置留存时间30秒 </font><br />              c1.setMaxAge(30); <br />              c2.setMaxAge(30); <br />              c3.setMaxAge(30); <br />                <br />              <font color="#008000">//将Cookie设置给客户端 </font><br />              <font color="#008000">//服务器向客户端传递数据，使用response对象 </font><br />              <font color="#008000">//方法：reponse.addCookie(Cookie cookie) </font><br />                <br />              response.addCookie(c1); <br />              response.addCookie(c2); <br />              response.addCookie(c3); <br />    %&gt; <br /></div>
								</div>
								<div> </div>
								<div class="a0" style="MARGIN: 0cm 0cm 0pt 21pt">
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">则运行</span>
										<span lang="EN-US">
												<font face="Verdana"> cookie03.jsp</font>
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">完成设置</span>
										<span lang="EN-US">
												<font face="Verdana">cookie</font>
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">后，即使另开一个浏览器窗口，直接运行</span>
										<span lang="EN-US">
												<font face="Verdana"> cookie02.jsp </font>
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">仍然可以取回</span>
										<span lang="EN-US">
												<font face="Verdana">cookie</font>
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">，</span>
										<font face="Verdana">
										</font>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">但时限到了之后</span>
										<span lang="EN-US">
												<font face="Verdana">cookie</font>
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">还是会失效。</span>
								</div>
								<div class="a0" style="MARGIN: 0cm 0cm 0pt 21pt">
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">但是，服务器自动设置的</span>
										<span lang="EN-US">
												<font face="Verdana">JSESSIONID</font>
										</span>
										<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: verdana; mso-hansi-font-family: verdana">还在。</span>
								</div>
								<div class="a" style="MARGIN: 0cm 0cm 0pt">
										<span lang="EN-US" style="mso-fareast-font-family: 宋体">
												<o:p> </o:p>
										</span>
								</div>
								<div class="a0" style="MARGIN: 0cm 0cm 0pt">
										<span lang="EN-US" style="mso-font-kerning: 0pt">
												<o:p>
														<font face="Verdana"> </font>
												</o:p>
										</span>
								</div>
								<div>
										<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">我的备注：一个</span>
										<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">servlet/jsp</span>
										<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">设置的路径能够被同一路径或子路径下的</span>
										<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 12.0pt;="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" 宋体;="" mso-fareast-font-family:="">servlet/jsp</span>
										<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " mso-bidi-font-size:="" mso-bidi-language:="" mso-fareast-language:="" mso-ansi-language:="" 12.0pt;="" mso-bidi-font-family:="" times="" new="" roman?;="" en-us;="" zh-cn;="" ar-sa?="" ?times="" mso-hansi-font-family:="">访问到，其它路径不能访问到。</span>
								</div>
						</span>
				</span>
		</span>
		<br />
<img src ="http://www.blogjava.net/yzzh9/aggbug/280910.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yzzh9/" target="_blank">999</a> 2009-06-09 13:41 <a href="http://www.blogjava.net/yzzh9/archive/2009/06/09/280910.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>