﻿<?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-&lt;font color='red'&gt;&lt;strong&gt;重新探索自我&lt;/strong&gt;&lt;/font&gt;-文章分类-技术总结</title><link>http://www.blogjava.net/danxy2008/category/7085.html</link><description>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;客观条件受制于人，并不足惧。重要的是，我们拥有选择的自由，可以对现实环境积极回应，&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;为生命负责，为自己创造有利的机会，做一个“真正”操之在我的人！&lt;br/&gt;</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 14:29:27 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 14:29:27 GMT</pubDate><ttl>60</ttl><item><title>在线播放器代码大全[转]</title><link>http://www.blogjava.net/danxy2008/articles/75843.html</link><dc:creator>蒋利文</dc:creator><author>蒋利文</author><pubDate>Wed, 18 Oct 2006 02:47:00 GMT</pubDate><guid>http://www.blogjava.net/danxy2008/articles/75843.html</guid><wfw:comment>http://www.blogjava.net/danxy2008/comments/75843.html</wfw:comment><comments>http://www.blogjava.net/danxy2008/articles/75843.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/danxy2008/comments/commentRss/75843.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/danxy2008/services/trackbacks/75843.html</trackback:ping><description><![CDATA[<p>
				<font color="#dc143c">
						<strong>1.avi格式</strong>
				</font>
		</p>
		<p>&lt;object id="video" width="400" height="200" border="0" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"&gt;<br />&lt;param name="ShowDisplay" value="0"&gt;<br />&lt;param name="ShowControls" value="1"&gt;<br />&lt;param name="AutoStart" value="1"&gt;<br />&lt;param name="AutoRewind" value="0"&gt;<br />&lt;param name="PlayCount" value="0"&gt;<br />&lt;param name="Appearance value="0 value="""&gt;<br />&lt;param name="BorderStyle value="0 value="""&gt;<br />&lt;param name="MovieWindowHeight" value="240"&gt;<br />&lt;param name="MovieWindowWidth" value="320"&gt;<br />&lt;param name="FileName" value="file:///D|/work/vod/Mbar.avi"&gt;<br />&lt;embed width="400" height="200" border="0" showdisplay="0" showcontrols="1" autostart="1" autorewind="0" playcount="0" moviewindowheight="240" moviewindowwidth="320" filename="file:///D|/work/vod/Mbar.avi" src="Mbar.avi"&gt;<br />&lt;/embed&gt; <br />&lt;/object&gt;</p>
		<br />
		<p>
				<font color="#dc143c">
						<strong>2.mpg格式</strong>
				</font>
		</p>
		<br />
		<p>&lt;object classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A" id="ActiveMovie1" width="239" height="250"&gt;<br />&lt;param name="Appearance" value="0"&gt;<br />&lt;param name="AutoStart" value="-1"&gt;<br />&lt;param name="AllowChangeDisplayMode" value="-1"&gt;<br />&lt;param name="AllowHideDisplay" value="0"&gt;<br />&lt;param name="AllowHideControls" value="-1"&gt;<br />&lt;param name="AutoRewind" value="-1"&gt;<br />&lt;param name="Balance" value="0"&gt;<br />&lt;param name="CurrentPosition" value="0"&gt;<br />&lt;param name="DisplayBackColor" value="0"&gt;<br />&lt;param name="DisplayForeColor" value="16777215"&gt;<br />&lt;param name="DisplayMode" value="0"&gt;<br />&lt;param name="Enabled" value="-1"&gt;<br />&lt;param name="EnableContextMenu" value="-1"&gt;<br />&lt;param name="EnablePositionControls" value="-1"&gt;<br />&lt;param name="EnableSelectionControls" value="0"&gt;<br />&lt;param name="EnableTracker" value="-1"&gt;<br />&lt;param name="Filename" value="../../../mpeg/halali.mpg" valuetype="ref"&gt;<br />&lt;param name="FullScreenMode" value="0"&gt;<br />&lt;param name="MovieWindowSize" value="0"&gt;<br />&lt;param name="PlayCount" value="1"&gt;<br />&lt;param name="Rate" value="1"&gt;<br />&lt;param name="SelectionStart" value="-1"&gt;<br />&lt;param name="SelectionEnd" value="-1"&gt;<br />&lt;param name="ShowControls" value="-1"&gt;<br />&lt;param name="ShowDisplay" value="-1"&gt;<br />&lt;param name="ShowPositionControls" value="0"&gt;<br />&lt;param name="ShowTracker" value="-1"&gt;<br />&lt;param name="Volume" value="-480"&gt;<br />&lt;/object&gt;</p>
		<br />
		<p>
				<br />
				<font color="#dc143c">
						<strong>3.rm格式</strong>
				</font>
		</p>
		<br />
		<p>&lt;OBJECT ID=video1 CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT=288 WIDTH=352&gt;</p>
		<br />
		<p>&lt;param name="_ExtentX" value="9313"&gt;<br />&lt;param name="_ExtentY" value="7620"&gt;<br />&lt;param name="AUTOSTART" value="0"&gt;<br />&lt;param name="SHUFFLE" value="0"&gt;<br />&lt;param name="PREFETCH" value="0"&gt;<br />&lt;param name="NOLABELS" value="0"&gt;<br />&lt;param name="SRC" value="rtsp://203.207.131.35/vod/dawan-a.rm";&gt;<br />&lt;param name="CONTROLS" value="ImageWindow"&gt;<br />&lt;param name="CONSOLE" value="Clip1"&gt;<br />&lt;param name="LOOP" value="0"&gt;<br />&lt;param name="NUMLOOP" value="0"&gt;<br />&lt;param name="CENTER" value="0"&gt;<br />&lt;param name="MAINTAINASPECT" value="0"&gt;<br />&lt;param name="BACKGROUNDCOLOR" value="#000000"&gt;&lt;embed SRC type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ImageWindow" HEIGHT="288" WIDTH="352" AUTOSTART="false"&gt;</p>
		<br />
		<p>&lt;/OBJECT&gt;</p>
		<br />
		<p>
				<font color="#dc143c">
						<strong>4.wmv格式</strong>
				</font>
		</p>
		<br />
		<p>&lt;object id="NSPlay" width=200 height=180 classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" align="right" hspace="5"&gt;<br />&lt;!-- ASX File Name --&gt;<br />&lt;param name="AutoRewind" value=1&gt;<br />&lt;param name="FileName" value="xxxxxx.wmv"&gt;<br />&lt;!-- Display Controls --&gt;</p>
		<br />
		<p>&lt;param name="ShowControls" value="1"&gt;<br />&lt;!-- Display Position Controls --&gt;</p>
		<br />
		<p>&lt;param name="ShowPositionControls" value="0"&gt;<br />&lt;!-- Display Audio Controls --&gt;</p>
		<br />
		<p>&lt;param name="ShowAudioControls" value="1"&gt;<br />&lt;!-- Display Tracker Controls --&gt;</p>
		<br />
		<p>&lt;param name="ShowTracker" value="0"&gt;<br />&lt;!-- Show Display --&gt;</p>
		<br />
		<p>&lt;param name="ShowDisplay" value="0"&gt;<br />&lt;!-- Display Status Bar --&gt;</p>
		<br />
		<p>&lt;param name="ShowStatusBar" value="0"&gt;<br />&lt;!-- Diplay Go To Bar --&gt;</p>
		<br />
		<p>&lt;param name="ShowGotoBar" value="0"&gt;<br />&lt;!-- Display Controls --&gt;</p>
		<br />
		<p>&lt;param name="ShowCaptioning" value="0"&gt;<br />&lt;!-- Player Autostart --&gt;</p>
		<br />
		<p>&lt;param name="AutoStart" value=1&gt;<br />&lt;!-- Animation at Start --&gt;</p>
		<br />
		<p>&lt;param name="Volume" value="-2500"&gt;<br />&lt;param name="AnimationAtStart" value="0"&gt;<br />&lt;!-- Transparent at Start --&gt;</p>
		<br />
		<p>&lt;param name="TransparentAtStart" value="0"&gt;<br />&lt;!-- Do not allow a change in display size --&gt;</p>
		<br />
		<p>&lt;param name="AllowChangeDisplaySize" value="0"&gt;<br />&lt;!-- Do not allow scanning --&gt;</p>
		<br />
		<p>&lt;param name="AllowScan" value="0"&gt;<br />&lt;!-- Do not show contect menu on right mouse click --&gt;</p>
		<br />
		<p>&lt;param name="EnableContextMenu" value="0"&gt;<br />&lt;!-- Do not allow playback toggling on mouse click --&gt;<br />&lt;param name="ClickToPlay" value="0"&gt;<br />&lt;/object&gt;</p>
		<br />
		<p>
				<font color="#dc143c">
						<strong>最简单的播放代码</strong>
				</font>
		</p>
		<br />
		<p>&lt;embed src="http://wmt2.aboutmedia.com.tw/Aboutmedia/warner/mtv/naying-021011_01v_120k.wmv";; <br />autostart="true" loop="true" width="200" height="150" &gt; <br />把这个网址http://wmt2.aboutmedia.com.tw/Aboutmedia/warner/mtv/naying-021011_01v_120k.wmv换成你要看的电影就行了</p>
		<br />
		<p>
				<br />
				<font color="#dc143c">
						<strong>有图像的rm格式：</strong>
				</font>
		</p>
		<br />
		<p>&lt;OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=288 id=video1 width=305 VIEWASTEXT&gt;<br />&lt;param name=_ExtentX value=5503&gt;<br />&lt;param name=_ExtentY value=1588&gt;<br />&lt;param name=AUTOSTART value=-1&gt;<br />&lt;param name=SHUFFLE value=0&gt;<br />&lt;param name=PREFETCH value=0&gt;<br />&lt;param name=NOLABELS value=0&gt;<br />&lt;param name=SRC value=http://media.cdut.edu.cn/ram/new/xiaoxin1.ram&gt;<br />&lt;param name=CONTROLS value=Imagewindow,StatusBar,ControlPanel&gt;<br />&lt;param name=CONSOLE value=RAPLAYER&gt;<br />&lt;param name=LOOP value=0&gt;<br />&lt;param name=NUMLOOP value=0&gt;<br />&lt;param name=CENTER value=0&gt;<br />&lt;param name=MAINTAINASPECT value=0&gt;<br />&lt;param name=BACKGROUNDCOLOR value=#000000&gt;<br />&lt;/OBJECT&gt;</p>
		<br />
		<p>
				<font color="#dc143c">
						<strong>无图像的rm格式：如相声，歌曲。。。</strong>
				</font>
		</p>
		<br />
		<p>&lt;object ID=video2 WIDTH=300 HEIGHT=62 CLASSID=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA&gt;<br />&lt;param name=_ExtentX value=9657&gt;<br />&lt;param name=_ExtentY value=847&gt;<br />&lt;param name=AUTOSTART value=-1&gt;<br />&lt;param name=SHUFFLE value=0&gt;<br />&lt;param name=PREFETCH value=0&gt;<br />&lt;param name=NOLABELS value=0&gt;<br />&lt;param name=SRC value=http://210.242.69.206/ramgen/broadcast/BCC/encoder/hipop.rm&gt;<br />&lt;param name=CONTROLS value=StatusBar,controlpanel&gt;<br />&lt;param name=CONSOLE value=Clip1&gt;<br />&lt;param name=LOOP value=0&gt;<br />&lt;param name=NUMLOOP value=0&gt;<br />&lt;param name=CENTER value=0&gt;<br />&lt;param name=MAINTAINASPECT value=0&gt;<br />&lt;param name=BACKGROUNDCOLOR value=#000000&gt;<br />&lt;/object&gt;<br /><font color="#dc143c">最简单的media格式的播放器。。自动识别有无图像，但是版本是你机器的！</font><br />&lt;embed src=mms://61.175.132.221/tv/mtv/f4/makeawish.wmv width=200 height=200 autostart=true loop=true&gt;&lt;/embed&gt;<br /><font color="#dc143c">有图像的media播放器，自动调用网上的插件。</font><br />&lt;object id=nstv classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 width=280 height=265 codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701standby=Loading Microsoft? Windows Media? Player components... type=application/x-oleobject&gt;<br />&lt;param name=URL value=http://202.99.11.42/xiangsheng/ymjr.wma&gt;<br />&lt;PARAM NAME=UIMode value=full&gt;&lt;PARAM NAME=AutoStart value=true&gt;<br />&lt;PARAM NAME=Enabled value=true&gt;<br />&lt;PARAM NAME=enableContextMenu value=false&gt;<br />&lt;param name=WindowlessVideo value=true&gt;&lt;/object&gt;<br /><font color="#dc143c">无图像的media播放器。。。同上。</font><br />&lt;object id=nstv classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 width=280 height=60 codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701standby=Loading Microsoft? Windows Media? Player components... type=application/x-oleobject&gt;<br />&lt;param name=URL value=http://202.99.11.42/xiangsheng/ymjr.wma&gt;<br />&lt;PARAM NAME=UIMode value=full&gt;&lt;PARAM NAME=AutoStart value=true&gt;<br />&lt;PARAM NAME=Enabled value=true&gt;<br />&lt;PARAM NAME=enableContextMenu value=false&gt;<br />&lt;/object&gt;<br /><font color="#dc143c">只是界面不同的media的调插件播放器。。建议不用这个，，你可以看！</font><br />&lt;embed src=http://av.wanwa.com/fileroot/AV/Ramfiles/23809.ram type=audio/x-pn-realaudio-plugin console=Clip1 controls=ControlPanel,StatusBar height=60 width=275 autostart=true&gt;&lt;/embed&gt;<br /></p>
		<br />
		<p>
				<font color="#dc143c">在线播放r m格式视频代码：</font>
		</p>
		<p>&lt;object id="player" name="player" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="272"&gt;<br />&lt;param name="_ExtentX" value="18415"&gt;<br />&lt;param name="_ExtentY" value="9102"&gt;<br />&lt;param name="AUTOSTART" value="-1"&gt;<br />&lt;param name="SHUFFLE" value="0"&gt;<br />&lt;param name="PREFETCH" value="0"&gt;<br />&lt;param name="NOLABELS" value="-1"&gt;<br />&lt;param name="SRC" value="http://www.xiaoqiong.com/ftp/up/bz.rm"&gt;<br />&lt;param name="CONTROLS" value="Imagewindow"&gt;<br />&lt;param name="CONSOLE" value="clip1"&gt;<br />&lt;param name="LOOP" value="0"&gt;<br />&lt;param name="NUMLOOP" value="0"&gt;<br />&lt;param name="CENTER" value="0"&gt;<br />&lt;param name="MAINTAINASPECT" value="0"&gt;<br />&lt;param name="BACKGROUNDCOLOR" value="#000000"&gt;<br />&lt;/object&gt;&lt;br&gt;<br />&lt;object ID="RP2" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" WIDTH="400" HEIGHT="57"&gt;<br />&lt;param name="_ExtentX" value="18415"&gt;<br />&lt;param name="_ExtentY" value="1005"&gt;<br />&lt;param name="AUTOSTART" value="-1"&gt;<br />&lt;param name="SHUFFLE" value="0"&gt;<br />&lt;param name="PREFETCH" value="0"&gt;<br />&lt;param name="NOLABELS" value="-1"&gt;<br />&lt;param name="SRC" value="http://www.xiaoqiong.com/ftp/up/bz.rm"&gt;<br />&lt;PARAM NAME="CONTROLS" VALUE="ControlPanel,StatusBar"&gt;<br />&lt;param name="CONSOLE" value="clip1"&gt;<br />&lt;param name="LOOP" value="0"&gt;<br />&lt;param name="NUMLOOP" value="0"&gt;<br />&lt;param name="CENTER" value="0"&gt;<br />&lt;param name="MAINTAINASPECT" value="0"&gt;<br />&lt;param name="BACKGROUNDCOLOR" value="#000000"&gt;<br />&lt;/object&gt;<br /></p><img src ="http://www.blogjava.net/danxy2008/aggbug/75843.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/danxy2008/" target="_blank">蒋利文</a> 2006-10-18 10:47 <a href="http://www.blogjava.net/danxy2008/articles/75843.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JAVA优化编程_part2</title><link>http://www.blogjava.net/danxy2008/articles/67997.html</link><dc:creator>蒋利文</dc:creator><author>蒋利文</author><pubDate>Wed, 06 Sep 2006 03:50:00 GMT</pubDate><guid>http://www.blogjava.net/danxy2008/articles/67997.html</guid><wfw:comment>http://www.blogjava.net/danxy2008/comments/67997.html</wfw:comment><comments>http://www.blogjava.net/danxy2008/articles/67997.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/danxy2008/comments/commentRss/67997.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/danxy2008/services/trackbacks/67997.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 三、表达式、语句与保留字																																																														1.														表达式																																																（				1...&nbsp;&nbsp;<a href='http://www.blogjava.net/danxy2008/articles/67997.html'>阅读全文</a><img src ="http://www.blogjava.net/danxy2008/aggbug/67997.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/danxy2008/" target="_blank">蒋利文</a> 2006-09-06 11:50 <a href="http://www.blogjava.net/danxy2008/articles/67997.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JAVA性能测试_Part1</title><link>http://www.blogjava.net/danxy2008/articles/testing.html</link><dc:creator>蒋利文</dc:creator><author>蒋利文</author><pubDate>Tue, 05 Sep 2006 08:25:00 GMT</pubDate><guid>http://www.blogjava.net/danxy2008/articles/testing.html</guid><wfw:comment>http://www.blogjava.net/danxy2008/comments/67834.html</wfw:comment><comments>http://www.blogjava.net/danxy2008/articles/testing.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/danxy2008/comments/commentRss/67834.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/danxy2008/services/trackbacks/67834.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b>
						<span style="COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">简介</span>
				</b>
				<span style="COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">1.J2EE性能测试<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">本书的方法用于一下两种情况：<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 57pt; TEXT-INDENT: -21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list 57.0pt" align="left">
				<span style="FONT-FAMILY: 'Bookshelf Symbol 7'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Bookshelf Symbol 7'; mso-ansi-language: ZH-CN; mso-fareast-font-family: 'Bookshelf Symbol 7'">
						<span style="mso-list: Ignore">ü<span style="FONT: 7pt 'Times New Roman'">       </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">性能测试一个完整的应用程序</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 57pt; TEXT-INDENT: -21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list 57.0pt" align="left">
				<span style="FONT-FAMILY: 'Bookshelf Symbol 7'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Bookshelf Symbol 7'; mso-ansi-language: ZH-CN; mso-fareast-font-family: 'Bookshelf Symbol 7'">
						<span style="mso-list: Ignore">ü<span style="FONT: 7pt 'Times New Roman'">       </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">性能设计----分析J2EE API不同方面的性能代价,以及某中设计决策对总体性能的影响。 <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b>
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">2.性能</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">开发的应用程序可以分为两类：</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">交互式的：响应时间为关键，两个度量标准，同时发生的用户数量和响应时间。可以用这样的语句来描述：“该应用程序能够以1000毫秒的最大响应时间处理750个同时发生的活跃用户；峰值时刻有800用户，响应时间下降7%</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">”</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">批处理或后端应用程序:吞吐量来描述。事务定义要一致，在研究servlet时，我们定义事务处理为一个请求，因此吞吐量是servlet在一个设定的时间周期内（1秒）执行的同样请求的数量。当分析JMS时，吞吐量就是message。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">3.</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">测试方法：<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">基准测试（Benchmarking）,在各种不同的环境下和工作负载下记录应用程序性能的过程。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">轮廓（Profiling）,这涉及到精确地调查应用程序将大部分计算周期花费在什么地方，以及应用程序效果和高效的使用系统资源。主要目标在与突出系统中的潜在的性能瓶颈。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">调整（Tuning），测试、基准测试和轮廓反馈给调整过程，然后优化应用程序。<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">另外，我们测试J2EE应用程序，可以从J2EE应用程序的各个组件开始，其各个组件包括数据库、JVM、操作系统、TCP/IP堆栈、web服务器、网络等等</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span style="COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">第一章测试方法<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span style="COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
								<o:p> </o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b>
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">1.方法概述</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">a.定义性能标准</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">为具体应用程序定义相关的性能度量标准，然后针对该度量标准设定一个现实的目标。建议清晰并没有歧义地定义性能度量标准，按照明确定义的要求测试。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">b.模拟应用程序使用</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">  </span>
						<span style="mso-spacerun: yes"> </span>这个步骤的关键在与测试脚本的定义。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes"> </span>
						<span style="mso-spacerun: yes"> </span>
						<span style="mso-spacerun: yes"> </span>
						<span style="mso-spacerun: yes"> </span>定义测试脚本:关键在于怎么样去更好的编写测试脚本，这需要实践的经验。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">  </span>
						<span style="mso-spacerun: yes"> </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">“</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">成功的性能测试关键在于理解应用程序将如何被使用</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">”，所以</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">测试数据，所提供的关键的用户数据必须动态生成</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">  </span>
						<span style="mso-spacerun: yes"> </span>
						<span style="mso-spacerun: yes"> </span>实际的使用模式：<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">思考时间（休眠时间）：指在执行测试脚本中每个请求之间间隔的时间。思考时间的两种基本策略：使用真实的时间思考；使用零思考时间。使用真实的时间思考，譬如用户输入要查询的电话是7秒种，那么我们说真实时间为7秒，但时间上是有偏差的，不能通过这样来提高系统的用户的并发数。这就是，时间偏差，考虑这些，通过适当降低时间来，譬如5秒，达到更加真实。当我们不清楚真实思考的时间的时候，我们可以采用零思考时间。<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">2.<span style="mso-bidi-font-weight: bold">采样方法</span></span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">不同的工具有不同的采样方法，The Grinder采用两种：</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">   </span>
						<span style="mso-spacerun: yes"> </span>周期方法，周期定义为一个模拟用户对一个测试脚本的完整执行。样本多才有意义。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">   </span>
						<span style="mso-spacerun: yes"> </span>快照方法，快照方法代表一种基于时间的数据视图。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">   </span>
						<span style="mso-spacerun: yes"> </span>数据排除，排除一些明显不稳定数据，譬如初始请求的时间。排除这些，样本的数据会更加准确。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">3.<span style="mso-bidi-font-weight: bold">性能统计数字</span></span>
				</b>
				<b>
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b>
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
								<span style="mso-spacerun: yes">   </span>
						</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">响应时间,客户端从发送请求的那一刻起收到应用程序响应的最后一个字节时止而不得不等待的时间长度。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-ascii-font-family: 宋体">“</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">10秒是让用户的注意力集中在应用程序对话框的极限</span>
				<span style="mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-ascii-font-family: 宋体">”</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">《Usablility Engneering》</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-ascii-font-family: 宋体">“</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">用户在等待8秒就点到别的地方去了</span>
				<span style="mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-ascii-font-family: 宋体">”</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">《Worth the wait ?》</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">   </span>响应时间的组成：处理时间，传输时间，绘制时间。我们在碰到响应时间的瓶劲的时候，可以从起组成来缩短响应时间。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">同时我们明白，</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'"> 我们在测试环境中几乎不可能模拟Internet的行为，所以只能最大可能接近的模拟。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">   </span>平均响应时间（ART），一个请求各个响应时间样本的平均值。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">   </span>总体平均响应时间（Aggregate Average Response Time,AART）: 测试脚本中每个单独测试的平均响应时间的和除以该测试脚本的请求数。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">   </span>最大平均响应时间（MART），不同请求的最大响应时间的平均值。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 5.25pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: .5; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">  </span>吞吐量，用TPS描述。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">4.<span style="mso-bidi-font-weight: bold">评价测试结果的准确性<o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">样本质量，样本数据的准确性。<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">公式：质量 = 标准方差/算术平均</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">，</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">可以接受的质量数位于0.06到0.2的范围内。当然，标准可以自定义。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">5.<span style="mso-bidi-font-weight: bold">性能测试<o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-bidi-font-weight: bold; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">测试的过程步骤：</span>
				<span style="FONT-FAMILY: 宋体; mso-bidi-font-weight: bold; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-bidi-font-weight: bold; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">a.</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">预备测试<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">预备测试考虑基准情况，测试环境的最佳化。</span>
				<span style="FONT-FAMILY: 宋体; mso-bidi-font-weight: bold; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">b.正式测试：单实例测试，持久测试，体系结构测试</span>
				<span style="FONT-FAMILY: 宋体; mso-bidi-font-weight: bold; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">单实例压力测试：应用程序运行在单一应用服务器实例，逐渐增加工作负载，直到操作性能标准。</span>
				<span style="FONT-FAMILY: 宋体; mso-bidi-font-weight: bold; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">  </span>持久测试：测试应用程序在较长时间内完成的性能情况。</span>
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体; mso-ansi-language: ZH-CN; mso-hansi-font-family: 'Times New Roman'">
						<span style="mso-spacerun: yes">  </span>体系结构测试：使用应用程序服务器群部署该应用程序。<br /><o:p><br />------------------------------------------------------<br />参考资料：<br />《J2EE性能测试》</o:p></span>
		</p>
<img src ="http://www.blogjava.net/danxy2008/aggbug/67834.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/danxy2008/" target="_blank">蒋利文</a> 2006-09-05 16:25 <a href="http://www.blogjava.net/danxy2008/articles/testing.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JAVA优化编程_Part1</title><link>http://www.blogjava.net/danxy2008/articles/67817.html</link><dc:creator>蒋利文</dc:creator><author>蒋利文</author><pubDate>Tue, 05 Sep 2006 07:33:00 GMT</pubDate><guid>http://www.blogjava.net/danxy2008/articles/67817.html</guid><wfw:comment>http://www.blogjava.net/danxy2008/comments/67817.html</wfw:comment><comments>http://www.blogjava.net/danxy2008/articles/67817.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/danxy2008/comments/commentRss/67817.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/danxy2008/services/trackbacks/67817.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 一、概述																																																								对于代码级的优化，不管用哪种程序语言编程，首先都应该注意编码规范和风格。不同的公司或者团队以至程序员个人都有自己的编码风格，但目的是让程序代码可读、简洁、高效、易于重用。养成良好的编码习惯是每个程序员的必需的。最开始，我们可以针对自己编...&nbsp;&nbsp;<a href='http://www.blogjava.net/danxy2008/articles/67817.html'>阅读全文</a><img src ="http://www.blogjava.net/danxy2008/aggbug/67817.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/danxy2008/" target="_blank">蒋利文</a> 2006-09-05 15:33 <a href="http://www.blogjava.net/danxy2008/articles/67817.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>J2ME 学习总结（一）</title><link>http://www.blogjava.net/danxy2008/articles/40903.html</link><dc:creator>蒋利文</dc:creator><author>蒋利文</author><pubDate>Thu, 13 Apr 2006 06:49:00 GMT</pubDate><guid>http://www.blogjava.net/danxy2008/articles/40903.html</guid><wfw:comment>http://www.blogjava.net/danxy2008/comments/40903.html</wfw:comment><comments>http://www.blogjava.net/danxy2008/articles/40903.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/danxy2008/comments/commentRss/40903.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/danxy2008/services/trackbacks/40903.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 14pt; COLOR: #3366ff">J2ME </span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 14pt; COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">学习总结（一）</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 14pt; COLOR: #3366ff">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本人学习</span>
				<span lang="EN-US">J2ME</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的原因是毕业设计课题的需要，要开发一个基于</span>
				<span lang="EN-US">J2ME</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的移动设备</span>
				<span lang="EN-US">3D</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">游戏，需要从基础一步一步学习。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">前言</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b>
						<span lang="EN-US">
								<o:p> </o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果大家没有接触过无线移动开发，可能想到要在手机运行自己写的程序或者游戏，一定很难；</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不过可以放心，这些东西一旦跟</span>
				<span lang="EN-US">java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扯上关系，那问题就好像没有那么复杂了；</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">今天就给大家介绍</span>
				<span lang="EN-US">j2me</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的一些基本知识</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">J2ME</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术概述</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">
								<o:p> </o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l3 level1 lfo2; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span lang="EN-US">J2ME</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</span>
				<span lang="EN-US">SUN</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">公司针对嵌入式、消费类电子产品推出的开发平台，与</span>
				<span lang="EN-US">J2SE</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span>
				<span lang="EN-US">J2EE</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">共同组成</span>
				<span lang="EN-US">Java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术的三个重要的分支。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l3 level1 lfo2; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span lang="EN-US">J2ME</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">平台是由配置（</span>
				<span lang="EN-US">Configuration</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）和简表（</span>
				<span lang="EN-US">Profile</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）构成的。配置是提供给最大范围设备使用的最小类库集合，譬如</span>
				<span lang="EN-US">IO</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，支持的数据类型等等，在配置中同时包含</span>
				<span lang="EN-US">Java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虚拟机。简表是针对一系列设备提供的开发包集合。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l3 level1 lfo2; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span lang="EN-US">J2ME</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中有两个最主要的配置，分别是</span>
				<span lang="EN-US">Connected Limited Devices Configuration</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">CLDC</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）和</span>
				<span lang="EN-US">Connected Devices Configuration</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">CDC</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）。</span>
				<span lang="EN-US"> CLDC</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">主要针对那些资源非常受限的设备比如手机、</span>
				<span lang="EN-US">PDA</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、双工寻呼机等。而</span>
				<span lang="EN-US">CDC</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">主要面对那些家电产品，比如机顶盒、汽车导航系统等。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l3 level1 lfo2; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">简表是以配置为基础的</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l3 level1 lfo2; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">例如</span>
				<span lang="EN-US">Mobile Information Devices Profile</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">MIDP</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）就是</span>
				<span lang="EN-US">CLDC</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上层的重要简表。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt" align="center">
				<span lang="EN-US">
						<o:p> <img src="file:///F:/blog/images/j2me_001.jpg" /></o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l3 level1 lfo2; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</span>
				<span lang="EN-US">MIDP</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中定义了一种新的应用程序模型</span>
				<span lang="EN-US">MIDlet</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，它是被</span>
				<span lang="EN-US">Application Management Software</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">AMS</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）管理的。</span>
				<span lang="EN-US">AMS</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">负责</span>
				<span lang="EN-US">MIDlet</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的安装、下载、运行和删除等操作。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l3 level1 lfo2; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在被</span>
				<span lang="EN-US">AMS</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">管理的同时，</span>
				<span lang="EN-US">MIDlet</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以和应用管理软件通信通知应用管理软件自己状态的变化，通常是通过方法</span>
				<span lang="EN-US">notifyDestroyed()</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span>
				<span lang="EN-US">notifyPaused()</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实现的</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l3 level1 lfo2; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span lang="EN-US">MIDlet</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有三个状态，分别是</span>
				<span lang="EN-US">pause</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US">active</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span>
				<span lang="EN-US">destroyed</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt" align="center">
				<span lang="EN-US">
						<o:p> <img src="file:///F:/blog/images/j2me_002.jpg" /></o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">J2ME</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的应用</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目前</span>
				<span lang="EN-US">J2ME</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">主要应用在移动电话上，主要是游戏开发。</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">事实上，</span>
				<span lang="EN-US">J2ME</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">能够做的内容有很多，绝对不应该局限于游戏。</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">SonyEricsson</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</span>
				<span lang="EN-US">Nokia</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等厂商都把重点转向了企业和产品应用层面，特别是与</span>
				<span lang="EN-US">J2EE</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">结合，将会一个完美的亮点；</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">另外</span>
				<span lang="EN-US">Mobile Java 3D</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为一个独立的领域也正在受到大家的广泛欢迎和关注。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我现在的毕业设计就是</span>
				<span lang="EN-US">Mobile Java 3D</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开发环境搭建</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">
								<o:p> </o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l2 level1 lfo3; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下载相关软件</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="FR" style="mso-ansi-language: FR">
						<span style="mso-tab-count: 1">       </span>
						<span style="mso-tab-count: 1">     </span>J2SE </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: FR">：</span>
				<span lang="FR" style="mso-ansi-language: FR">JDK 1.4 or later</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: FR">，</span>
				<span lang="FR" style="mso-ansi-language: FR">
						<a href="http://java.sun.com/">http://java.sun.com</a>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">无线开发包</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: FR">：</span>
				<span lang="FR" style="mso-ansi-language: FR">WTK 2.2 or later </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: FR">，</span>
				<span lang="FR" style="mso-ansi-language: FR">http://java.sun.com<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">　</span>
				<span lang="FR" style="mso-ansi-language: FR">
						<span style="mso-spacerun: yes">  </span>
						<span style="mso-spacerun: yes">      </span>IDE</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: FR">：</span>
				<span lang="FR" style="mso-ansi-language: FR">Eclipse 3.1</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: FR">，</span>
				<span lang="EN-US">
						<a href="http://www.eclipse.org/" target="_parent">
								<span lang="FR" style="mso-ansi-language: FR">http://www.eclipse.org</span>
						</a>
				</span>
				<span lang="FR" style="mso-ansi-language: FR">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="FR" style="mso-ansi-language: FR">
						<span style="mso-spacerun: yes">      </span>
						<span style="mso-spacerun: yes">     </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开发插件：</span>
				<span lang="EN-US">Eclipse Me 1.2</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">      </span>
						<span style="mso-spacerun: yes">     </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">其他可选包：</span>
				<span lang="EN-US">Nokia SDK</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">           </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">注意：下载开发插件的时候选择与</span>
				<span lang="EN-US">Eclipse</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">匹配的版本，当前使用的</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">                 </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">版本为</span>
				<span lang="EN-US">1.2</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，支持</span>
				<span lang="EN-US">Eclipse 3.x </span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo4; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">搭建过程</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 15pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第一步</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装</span>
				<span lang="EN-US">JDK</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 15pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第二步</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装</span>
				<span lang="EN-US">WTK</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，双击安装包，下一步到底</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 15pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第三步</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装</span>
				<span lang="EN-US">Eclipse</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 15pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第四步</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装</span>
				<span lang="EN-US">Eclipse Me</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插件</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">            </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装</span>
				<span lang="EN-US">Eclipse</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插件方式很多，可以直接更新安装，也可以直接</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">            </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下载插件安装包安装，我们采用第二种方式：分别拷贝</span>
				<span lang="EN-US">features</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">            </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span>
				<span lang="EN-US">plugins</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的文件到</span>
				<span lang="EN-US">Eclipse</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对应的目录下，删除</span>
				<span lang="EN-US">Eclipse</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装目录</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">            </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对应的</span>
				<span lang="EN-US">configuration</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下的</span>
				<span lang="EN-US">org.eclipse.update</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件夹，然后再启动</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">            </span>Eclipse</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">即可</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l4 level1 lfo5; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装完成后，启动</span>
				<span lang="EN-US">Eclipse,</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在菜单栏</span>
				<span lang="EN-US">window/preferences</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以看到：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt" align="center">
				<span lang="EN-US">
						<o:p>
								<img src="file:///F:/blog/images/j2me_003.jpg" /> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l4 level1 lfo5; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">然后选择</span>
				<span lang="EN-US">platform Components</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">项添加</span>
				<span lang="EN-US">WTK</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt" align="center">
				<span lang="EN-US">
						<o:p> <img src="file:///F:/blog/images/j2me_004.jpg" /></o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l4 level1 lfo5; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">选择</span>
				<span lang="EN-US">WTK</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装目录</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt" align="center">
				<span lang="EN-US">
						<o:p> <img src="file:///F:/blog/images/j2me_005.jpg" /></o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l4 level1 lfo5; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装完毕，新建一个</span>
				<span lang="EN-US">J2ME</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">项目测试一下</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt" align="center">
				<span lang="EN-US">
						<o:p> <img src="file:///F:/blog/images/j2me_006.jpg" /></o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l4 level1 lfo5; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">新建一个</span>
				<span lang="EN-US">Midlet</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序<br /><img src="F:\blog\images\j2me_007.jpg" /><br /></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l4 level1 lfo5; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行<br /><img src="F:\blog\images\j2me_008.jpg" /><br /></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l4 level1 lfo5; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行结果出现默认手机模样（左图）</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt" align="center">
				<span lang="EN-US">
						<o:p> <img style="WIDTH: 128px; HEIGHT: 372px" height="495" src="F:\blog\images\j2me_009.jpg" width="204" /></o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> <strong>一个简单的HelloWorld例子</strong></o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l4 level1 lfo5; tab-stops: list 36.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">•<span style="FONT: 7pt 'Times New Roman'">         </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">黑色部分为</span>
				<span lang="EN-US">Midlet</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">框架部分，插件自动生成，我们只需要添加少量代码</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">import javax.microedition.midlet.*;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">public class HelloWorld extends MIDlet {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">     </span>
						<span style="COLOR: red">private<span style="mso-spacerun: yes">  </span>Display dispaly = null; <o:p></o:p></span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">   </span>
						<span style="mso-spacerun: yes">  </span>public HelloWorld(){</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">       </span>
						<span style="COLOR: red">
								<span style="mso-tab-count: 1">   </span>display = Display.getDisplay(this); <o:p></o:p></span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">     </span>}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">
						</span>
						<span style="mso-tab-count: 1">       </span>protected void startApp() throws MIDletStateChangeException {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">
						</span>
						<span style="mso-spacerun: yes">  </span>
						<span style="mso-tab-count: 1">    </span>
						<span style="mso-tab-count: 2">              </span>
						<span style="COLOR: red">Form form = new Form(</span>
				</span>
				<span style="COLOR: red; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">“</span>
				<span lang="EN-US" style="COLOR: red">Hello world!</span>
				<span style="COLOR: red; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">”</span>
				<span lang="EN-US" style="COLOR: red">)<span style="mso-tab-count: 1">  </span>;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US" style="COLOR: red">
						<span style="mso-spacerun: yes">          </span>
						<span style="mso-tab-count: 1">     </span>display.setCurrent(form); <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">
						</span>
						<span style="mso-tab-count: 1">       </span>}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">
						</span>
						<span style="mso-tab-count: 1">       </span>protected void pauseApp() {}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">
						</span>
						<span style="mso-tab-count: 1">       </span>protected void destroyApp(boolean arg0) throws MIDletStateChangeException {}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">MIDP2.0</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">常用</span>
						<span lang="EN-US">API</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">介绍<br /></span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p>
								<br />    待续......</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">
								<o:p> </o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
<img src ="http://www.blogjava.net/danxy2008/aggbug/40903.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/danxy2008/" target="_blank">蒋利文</a> 2006-04-13 14:49 <a href="http://www.blogjava.net/danxy2008/articles/40903.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SpringMVC框架学习</title><link>http://www.blogjava.net/danxy2008/articles/29083.html</link><dc:creator>蒋利文</dc:creator><author>蒋利文</author><pubDate>Tue, 24 Jan 2006 03:47:00 GMT</pubDate><guid>http://www.blogjava.net/danxy2008/articles/29083.html</guid><wfw:comment>http://www.blogjava.net/danxy2008/comments/29083.html</wfw:comment><comments>http://www.blogjava.net/danxy2008/articles/29083.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/danxy2008/comments/commentRss/29083.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/danxy2008/services/trackbacks/29083.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">衡量一个</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">MVC</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">框架模式，主要通过三种</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">web</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模式，本人认为</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">springMVC</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一个很好的</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">MVC<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模式，对模式的支持如下：</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">1</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）派遣器模式</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Spring</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有一个统一集中的派遣器</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">org.springFramework.Web.Servlet.DispatcherServlet,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般在</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">web.XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中把所有的页面请求都发送到该派遣器：</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;servlet&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;servlet-name&gt;countries&lt;/servlet-name&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;load-on-startup&gt;2&lt;/load-on-startup&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/servlet&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;servlet-mapping&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;servlet-name&gt;countries&lt;/servlet-name&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/servlet-mapping&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">2</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）控制器模式</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">派遣器收到请求后</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">,</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把不同的页面派遣到不同的控制器进行处理：</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;bean<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>id="urlMapping" <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>&lt;property name="mappings"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;props&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;prop key="/home.htm"&gt;countriesController&lt;/prop&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;prop key="/notfound.htm"&gt;errorsController&lt;/prop&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 42pt; mso-char-indent-count: 4.0"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/props&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;/property&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Spring</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有两种</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">MAPPING</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的机制</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">,</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">默认为</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">BeanNameUrlHandlerMapping,</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们这里采用的是</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">SimpleUrlHandlerMapping.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">3</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）拦截器模式</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在控制器处理前</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">,</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们可以将其拦截</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">,</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行一些特殊或通用处理</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">;</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">拦截器可以选用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Spring</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">已经实现的或我们自己实现的：</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;bean <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>id="urlMapping" <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;property name="interceptors"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;list&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;ref local="localeChangeInterceptor"/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;ref local="themeChangeInterceptor"/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;ref local="copyInterceptor"/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/list&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;/property&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">详细介绍：</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">①</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="mso-bidi-font-size: 10.0pt"> </SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分发器：</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Dispatcherservlet<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">整个</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">spring</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用只需要一个分发器</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;servlet&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;servlet-name&gt;springapp&lt;/servlet-name&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;servlet-class&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>org.springframework.web.servlet.DispatcherServlet<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/servlet-class&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/servlet&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;!-- </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">映射的类型</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">--&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;servlet-mapping&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;servlet-name&gt;springapp&lt;/servlet-name&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;url-pattern&gt;*.do&lt;/url-pattern&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/servlet-mapping&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;servlet-mapping&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;servlet-name&gt;springapp&lt;/servlet-name&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;url-pattern&gt;*.html&lt;/url-pattern&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/servlet-mapping&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理器映射</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般对应文件</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"> servlet-name-servlet.xml,</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">譬如</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"> springapp-servlet.xml<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">BeanNameUrlHandlerMapping<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">SimpleUrlHandlerMapping<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;!--Request Mapping --&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;bean id="urlMapping"<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;property name="mappings"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;props&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;prop key="login.do"&gt;LoginController&lt;/prop&gt;<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;prop key="login.html"&gt;LoginController&lt;/prop&gt;<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/props&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/property&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">②</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="mso-bidi-font-size: 10.0pt"> </SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控制器</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控制器的基础接口</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"> Controller </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，包含方法</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ModelAndView handleRequest(HttpServletRequest request,HttpServletResponse response) <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">throws Exception;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"> return new ModelAndView(</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">“”</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">);</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也可以使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">response.sendRedirect(</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">“”</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">).;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">AbstractController</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控制器继承</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Controller</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类，增加譬如缓存、</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">minetype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等功能，处理多个动作，可以使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">MultiActionController<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">但如果要表单和数据对象的交互，我们就使用命令控制器</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">AbstractCommandController</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">带参的形式，把相关的功能放在一个</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">controller<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">譬如用户的添加、修改、删除，就可以采用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"> usemanage.do?msg=add/modify/delete</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的形式</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">SimpleFormController</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">更为具体，但继承它实现的</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">OnSubmit</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的方法，不好用，譬如不能后退或者用于超链接等方式的地址直接响应。</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">③</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="mso-bidi-font-size: 10.0pt"> </SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理器映射拦截器</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">拦截器接口定义了三个方法，一个在处理器执行前被调用，一个在处理器执行后被调用，还有一个在整个请求完成后调用。譬如在在上午</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">9</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">点到下午</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">6</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">点重定向某个页面，</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">handlerMapping</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">那个</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">bean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里面加入</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;property name=”interceptors”&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;list&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;ref bean=”officeHourIntercptor”&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/list&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/property&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">然后一个处理</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Bean<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;bean id=” officeHourIntercptor”<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>class=” TimeBaseIntercptor”&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;property name=”openTime”&gt; &lt;value&gt;9&lt;/value&gt; &lt;/property&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;property name=”closeTime”&gt; &lt;value&gt;18&lt;/value&gt; &lt;/property&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">④</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="mso-bidi-font-size: 10.0pt"> </SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">视图与解析器</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Spring</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">框架控制器返回的是</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">ModelAndView</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，对于一般的</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">JSP</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Servlet,</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">InternalResourceViewResolver</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，继承于</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">UrlBaseViewResovler<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">&lt;bean id="viewResolver"<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;property name="viewClass"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;value&gt;org.springframework.web.servlet.view.JstlView&lt;/value&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/property&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当一个</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">web</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中使用不同类型的视图技术，使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">ResourceBandleViewResolver<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">⑤</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="mso-bidi-font-size: 10.0pt"> </SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用本地化信息</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">Spring</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">框架大部分支持国际化，像</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">web</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">框架一样，自动解析客户端信息</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">但我们可以自己手动获取客户端信息，并做需要的参数设计来改变属性</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">LocalChangeInterceptor</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">修改本地化信息，这个像拦截器一样使用</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>&lt;bean <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>id="localeChangeInterceptor"<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;property name="paramName"&gt;&lt;value&gt;siteLanguage&lt;/value&gt;&lt;/property&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>&lt;/bean&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>&lt;bean id="localeResolver" <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt">class="org.springframework.web.servlet.i18n.CookieLocaleResolver"/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.0pt"><o:p>&nbsp;</o:p></SPAN></P><img src ="http://www.blogjava.net/danxy2008/aggbug/29083.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/danxy2008/" target="_blank">蒋利文</a> 2006-01-24 11:47 <a href="http://www.blogjava.net/danxy2008/articles/29083.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>BS开发中常用的javascript技术（转载）</title><link>http://www.blogjava.net/danxy2008/articles/29019.html</link><dc:creator>蒋利文</dc:creator><author>蒋利文</author><pubDate>Mon, 23 Jan 2006 07:25:00 GMT</pubDate><guid>http://www.blogjava.net/danxy2008/articles/29019.html</guid><wfw:comment>http://www.blogjava.net/danxy2008/comments/29019.html</wfw:comment><comments>http://www.blogjava.net/danxy2008/articles/29019.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/danxy2008/comments/commentRss/29019.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/danxy2008/services/trackbacks/29019.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 一、验证类 1、数字验证内 &nbsp; 1.1 整数 &nbsp; 1.2 大于0的整数 （用于传来的ID的验证) &nbsp; 1.3 负整数的验证 &nbsp; 1.4 整数不能大于iMax &nbsp; 1.5 整数不能小于iMin 2、时间类 &nbsp; 2.1 短时间，形如 (13:04:06) &nbsp; 2.2 短日期，形如 (2003-12-05) &nbsp; 2.3 长时...&nbsp;&nbsp;<a href='http://www.blogjava.net/danxy2008/articles/29019.html'>阅读全文</a><img src ="http://www.blogjava.net/danxy2008/aggbug/29019.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/danxy2008/" target="_blank">蒋利文</a> 2006-01-23 15:25 <a href="http://www.blogjava.net/danxy2008/articles/29019.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Hibernate学习总结</title><link>http://www.blogjava.net/danxy2008/articles/28437.html</link><dc:creator>蒋利文</dc:creator><author>蒋利文</author><pubDate>Wed, 18 Jan 2006 02:42:00 GMT</pubDate><guid>http://www.blogjava.net/danxy2008/articles/28437.html</guid><wfw:comment>http://www.blogjava.net/danxy2008/comments/28437.html</wfw:comment><comments>http://www.blogjava.net/danxy2008/articles/28437.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/danxy2008/comments/commentRss/28437.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/danxy2008/services/trackbacks/28437.html</trackback:ping><description><![CDATA[<P><FONT size=+1><STRONG>一、Hibernate 的 CRUD 基本操作</STRONG></FONT> <BR></P>
<P><BR>// 取得 session ，通常我们利用 hibernate.cfg.xml 的配置 </P>
<P>// 以用户表和部门为例 </P>
<P align=left>Configuration config = <STRONG>new </STRONG>Configuration().configure(); </P>
<P align=left>SessionFactory sessionFactory = </P>
<P align=left>config.buildSessionFactory(); </P>
<P align=left>Session session = sessionFactory.openSession(); </P>
<P>（1） 查询数据 </P>
<P>// 取所有记录 </P>
<P>Criteria criteria = session.createCriteria(User.class); </P>
<P>Query query = session. createQuery ; </P>
<P>List resultList = criteria.list()/ query . list(); </P>
<P>// 按条件查询 </P>
<P>Query query = session .createQuery("from User where id between :ID1 and :ID2"); </P>
<P>query.setInteger("ID1",0); </P>
<P>query.setInteger("ID2",2); </P>
<P>Criteria criteria = getSession().createCriteria(User.class); </P>
<P>criteria.add(Restrictions.eq("id",new Integer(1))); </P>
<P>// 更复查的查询见 Criteria 详解 </P>
<P>（2） 插入记录 </P>
<P>// 不设关联的时候，可以直接 save 一个对象 </P>
<P>User user = new User(); </P>
<P>user.setUserName(“jiangliwen”); </P>
<P>user.setSex(“ 男 ”); </P>
<P>session.save(user); </P>
<P>（3） 删除记录 </P>
<P>// 把一个 POJO 变成 PO 后就可以删除，不过有时候方法会在删除的时候自动变为 PO </P>
<P>// 当你发现 User user = new User(New Integer(1)), 出错的时候，说明不行 </P>
<P>User user = (User)session.load(User.class,new Integer(1)); </P>
<P>session.delete(user); </P>
<P>（4） 更新记录 </P>
<P>// 过程为取出、修改、保存 </P>
<P>User user = (User)session.load(User.class,new Integer(1)); </P>
<P>user.setRealName(“ 哈哈 ”); </P>
<P>session.update(user); </P>
<P align=left><FONT size=+1><STRONG>二、Criteria 查询总结，能完成一般查询、统计、分组、多表查询 </STRONG></FONT></P>
<P align=left><BR>填入任一查询参数，模糊查询 </P>
<P align=left><STRONG>Criteria criteria = getSession().createCriteria(User.class); </STRONG><BR><STRONG>criteria.add(Restrictions.eq("id",new Integer(1))); </STRONG><BR><STRONG>List list = criteria.list(); </STRONG><BR><STRONG>criteria.add(Restrictions. like("username",”%jiang%”)); </STRONG></P>
<P align=left>您可以使用 Criteria 進行查詢，並使用 Order 對結果進行排序，例如使用 Oder.asc() 由小到大排序<BR>（反之則使用 desc() ）： </P>
<P align=left><STRONG>Criteria criteria = session.createCriteria(User.class); <BR>criteria.addOrder(Order.asc("age")); <BR>List users = criteria.list(); </STRONG></P>
<P align=left><BR>setMaxResults() 方法可以限定查詢回來的筆數，如果配合 setFirstResult() 設定傳回查詢結果<BR>第一筆資料的位置，就可以實現簡單 的分頁，例如傳回第 51 筆之後的 50 筆資料（如果有的話）： </P>
<P align=left><STRONG>Criteria criteria = session.createCriteria(User.class); <BR>criteria.setFirstResult(51); <BR>criteria.setMaxResult(50); <BR>List users = criteria.list(); </STRONG></P>
<P align=left><BR>您可以對查詢結果進行統計動作，使用 Projections 的 avg() 、 rowCount() 、 count() 、 max() 、 min() 、<BR>countDistinct() 等方法，例如對查詢結果的 "age" 作平均： </P>
<P align=left><STRONG>Criteria criteria = session.createCriteria(User.class); <BR>criteria.setProjection(Projections.avg("age")); <BR>List users = criteria.list(); <BR>Iterator iterator = users.iterator(); <BR>while(iterator.hasNext()) { <BR>System.out.println(iterator.next()); <BR>} </STRONG></P>
<P align=left><BR>還可以配合 Projections 的 groupProperty() 來對結果進行分組，例如以 "age" 進行分組，也就是如果資料中 "age" <BR>如果有 20 、 20 、 25 、 30 ，則以下會顯示 20 、 25 、 30 ： </P>
<P align=left><STRONG>Criteria criteria = session.createCriteria(User.class); <BR>criteria.setProjection(Projections.groupProperty("age")); <BR>List users = criteria.list(); <BR>Iterator iterator = users.iterator(); <BR>while(iterator.hasNext()) { <BR>System.out.println(iterator.next()); <BR>} </STRONG></P>
<P align=left><BR>如果想結合統計與分組功能，則可以使用 ProjectionList ，例如下面的程式會計算每個年齡各有多少個人： </P>
<P align=left><STRONG>ProjectionList projectionList = Projections.projectionList(); <BR>projectionList.add(Projections.groupProperty("age")); <BR>projectionList.add(Projections.rowCount()); <BR><BR>Criteria criteria = session.createCriteria(User.class); <BR>criteria.setProjection(projectionList); <BR>List users = criteria.list(); <BR>Iterator iterator = users.iterator(); <BR>while(iterator.hasNext()) { <BR>Object[] o = (Object[]) iterator.next(); <BR>System.out.println(o[0] + "\t" + o[1]); <BR>} </STRONG></P>
<P align=left><BR>如果有一個已知的物件，則可以根據這個物件作為查詢的依據，看看是否有屬性與之類似的物件，例如： </P>
<P align=left><STRONG>User user = new User(); <BR>user.setAge(new Integer(30)); <BR><BR>Criteria criteria = session.createCriteria(User.class); <BR>criteria.add(Example.create(user)); <BR><BR>List users = criteria.list(); <BR>Iterator iterator = users.iterator(); <BR>System.out.println("id \t name/age"); <BR>while(iterator.hasNext()) { <BR>User ur = (User) iterator.next(); <BR>System.out.println(ur.getId() + <BR>" \t " + ur.getName() + <BR>"/" + ur.getAge()); <BR>} </STRONG></P>
<P align=left><BR>在這個例子中， user 物件中有已知的屬性 "age" 為 30 ，使用 Example 會自動過濾掉 user 的空屬性，<BR>並以之作為查詢的依據，也就是找出 "age" 同為 30 的資料。 <BR><BR>Criteria 可以進行複合查詢，即在原有的查詢基礎上再進行查詢，例如在 Room 對 User 的一對多關聯中，<BR>在查詢出所有的 Room 資料之後，希望再查詢 users 中 "age" 為 30 的 user 資料： </P>
<P align=left><STRONG>Criteria roomCriteria = session.createCriteria(Room.class); <BR>Criteria userCriteria = roomCriteria.createCriteria("users"); <BR>userCriteria.add(Restrictions.eq("age", new Integer(30))); <BR>List rooms = roomCriteria.list(); // </STRONG><STRONG>只列出 </STRONG><STRONG>users </STRONG><STRONG>屬性中有 </STRONG><STRONG>user </STRONG><STRONG>之 </STRONG><STRONG>"age" </STRONG><STRONG>為 </STRONG><STRONG>30 </STRONG><STRONG>的 </STRONG><STRONG>Room <BR>Iterator iterator = rooms.iterator(); </STRONG></P>
<P align=left><STRONG></STRONG></P>
<P align=left><FONT size=+1><STRONG>三、Hibernate </STRONG><STRONG>的事务管理 </STRONG><STRONG></STRONG></FONT></P>
<P align=left>Hibernate 是 JDBC 的轻量级封装，本身并不具备事务管理能力。在事务管理层， </P>
<P align=left>Hibernate 将其委托给底层的 JDBC 或者 JTA ，以实现事务管理和调度功能。 </P>
<P align=left>Hibernate 的默认事务处理机制基于 JDBC Transaction 。我们也可以通过配置文 </P>
<P align=left>件设定采用 JTA 作为事务管理实现： </P>
<P align=left>&lt; property name = "hibernate.transaction.factory_class" &gt; </P>
<P align=left>net.sf.hibernate.transaction.JTATransactionFactory </P>
<P align=left>&lt;!--net.sf.hibernate.transaction.JDBCTransactionFactory--&gt; </P>
<P align=left>&lt;/ property &gt; </P>
<P align=left><STRONG>基于 </STRONG><STRONG>JDBC </STRONG><STRONG>的事务管理 </STRONG><STRONG></STRONG></P>
<P align=left>session = sessionFactory.openSession(); </P>
<P align=left>Transaction tx = session.beginTransaction(); </P>
<P align=left>…… </P>
<P align=left>tx.commit(); </P>
<P align=left>从 JDBC 层面而言，上面的代码实际上对应着： </P>
<P align=left>Connection dbconn = getConnection(); </P>
<P align=left>dbconn.setAutoCommit( <STRONG>false </STRONG>); </P>
<P align=left>…… </P>
<P align=left>dbconn.commit(); </P>
<P align=left><STRONG>基于 </STRONG><STRONG>JTA </STRONG><STRONG>的事务管理 </STRONG><STRONG></STRONG></P>
<P align=left>JTA 提供了跨 Session 的事务管理能力。这一点是与 JDBC Transaction 最大的 </P>
<P align=left>差异。 </P>
<P align=left>JDBC 事务由 Connnection 管理，也就是说，事务管理实际上是在 JDBC Connection </P>
<P align=left>中实现。事务周期限于 Connection 的生命周期之类。同样，对于基于 JDBC Transaction </P>
<P align=left>的 Hibernate 事务管理机制而言，事务管理在 Session 所依托的 JDBC Connection </P>
<P align=left>中实现，事务周期限于 Session 的生命周期。 </P>
<P align=left>JTA 事务管理则由 JTA 容器实现， JTA 容器对当前加入事务的众多 Connection 进 </P>
<P align=left>行调度，实现其事务性要求。 JTA 的事务周期可横跨多个 JDBC Connection 生命周期。 </P>
<P align=left>同样对于基于 JTA 事务的 Hibernate 而言， JTA 事务横跨可横跨多个 Session 。 </P>
<P align=left>因此当 open 多个 session 时候，用 JTA 来管理事务。 </P>
<P align=left>在 EJB 中使用 JTA Transaction 无疑最为简便，我们只需要将 save 方法配置为 </P>
<P align=left>JTA 事务支持即可，无需显式申明任何事务，下面是一个 Session Bean 的 save 方法， </P>
<P align=left>它的事务属性被申明为“ Required ”， EJB 容器将自动维护此方法执行过程中的事务： </P>
<P align=left>Hibernate 支持两种锁机制：即通常所说的“悲观锁（ Pessimistic Locking ）” </P>
<P align=left>和“乐观锁（ Optimistic Locking ）” </P>
<P align=left>悲观锁：保守态度，一旦上锁，外界无法修改，直到释放 </P>
<P align=left>乐观锁： Hibernate 在其数据访问引擎中内置了乐观锁实现。如果不用考虑外部系统对数 </P>
<P align=left>据库的更新操作，利用 Hibernate 提供的透明化乐观锁实现，将大大提升我们的 </P>
<P align=left>生产力。 </P>
<P align=left>&lt; class </P>
<P align=left>name = "org.hibernate.sample.TUser" </P>
<P align=left>table = "t_user" </P>
<P align=left>dynamic-update = "true" </P>
<P align=left>dynamic-insert = "true" </P>
<P align=left><STRONG>optimistic-lock </STRONG><STRONG>= </STRONG><STRONG>"version" </STRONG></P>
<P align=left>&gt; </P>
<P align=left>乐观锁，大多是基于数据版本 </P>
<P align=left>（ Version ）记录机制实现。 </P>
<P align=left><STRONG>Cache </STRONG><STRONG>管理 </STRONG><STRONG></STRONG></P>
<P align=left>使用 cache 的目的往往是为了提高系统的性能； </P>
<P align=left>引入 Cache 机制的难点是如何保证内存中数据的有效性，否则脏数据的出现将给系统 </P>
<P align=left>带来难以预知的严重后果。 </P>
<P align=left>Hibernate 中的 Cache 大致分为两层，第一层 Cache 在 Session 实现，属于事务 </P>
<P align=left>级数据缓冲，一旦事务结束，这个 Cache 也就失效。 </P>
<P align=left>第二层 Cache ，是 Hibernate 中对其实例范围内的数据进行缓存的管理容器。 </P>
<P align=left>我们需要讨论的是第二层 Cache, 最简单是基于 HashTable 的 cache 机制 . </P>
<P align=left>使用了 Cache 机制之后，应当注意编码的结合，特别在查询数据的时候使用： </P>
<P align=left>Query.list(); 取出所有的数据 ， 一次 sql </P>
<P align=left>Query.iterate(); 两次 sql, 一次去 ID ， 如果有 cache 则优先查找，二次才取数据 </P>
<P align=left><STRONG>Session </STRONG><STRONG>管理 </STRONG><STRONG></STRONG></P>
<P align=left>SessionFactory 负责创建 Session ， SessionFactory 是线程 </P>
<P align=left>安全的，多个并发线程可以同时访问一个 SessionFactory 并从中获取 Session 实例。而 </P>
<P align=left>Session 并非线程安全，也就是说，如果多个线程同时使用一个 Session 实例进行数据存取， </P>
<P align=left>则将会导致 Session 数据存取逻辑混乱。 </P>
<P align=left>我们可以通过应用 ThreadLocal 机制 , 来维持一个 session </P>
<P align=left><STRONG>public class </STRONG>HibernateUtil { </P>
<P align=left><STRONG>private static </STRONG>SessionFactory sessionFactory; </P>
<P align=left><STRONG>static </STRONG>{ </P>
<P align=left><STRONG>try </STRONG>{ </P>
<P align=left>// Create the SessionFactory </P>
<P align=left>sessionFactory = <STRONG>new </STRONG></P>
<P align=left>Configuration().configure().buildSessionFactory(); </P>
<P align=left>} <STRONG>catch </STRONG>(HibernateException ex) { </P>
<P align=left><STRONG>throw new </STRONG>RuntimeException( </P>
<P align=left>"Configuration problem: " + ex.getMessage(), </P>
<P align=left>ex </P>
<P align=left>); </P>
<P align=left>} </P>
<P align=left>} </P>
<P align=left><STRONG>public static final </STRONG>ThreadLocal session = <STRONG>new </STRONG>ThreadLocal(); </P>
<P align=left><STRONG>public static </STRONG>Session currentSession() <STRONG>throws </STRONG>HibernateException </P>
<P align=left>{ </P>
<P align=left>Session s = (Session) session.get(); </P>
<P align=left>// Open a new Session, if this Thread has none yet </P>
<P align=left><STRONG>if </STRONG>(s == <STRONG>null </STRONG>) { </P>
<P align=left>s = sessionFactory.openSession(); </P>
<P align=left>session.set(s); </P>
<P align=left>} </P>
<P align=left><STRONG>return </STRONG>s; </P>
<P align=left>} </P>
<P align=left><STRONG>public static void </STRONG>closeSession() <STRONG>throws </STRONG>HibernateException { </P>
<P align=left>Session s = (Session) session.get(); </P>
<P align=left>session.set( <STRONG>null </STRONG>); </P>
<P align=left><STRONG>if </STRONG>(s != <STRONG>null </STRONG>) </P>
<P align=left>s.close(); </P>
<P align=left>} </P>
<P align=left>} </P>
<P align=left>对于 web 程序而言 </P>
<P align=left>我们可以借助 Servlet2.3 规范中新引入的 Filter 机制，轻松实现线程生命周期内的 Session 管理 </P>
<P align=left><FONT size=+1><STRONG>四、再度思考</STRONG></FONT></P>
<P>1 、对 ORM 的理解 </P>
<P align=left>ORM （ Object Relational Mapping ）简单的说，就是对象与关系的映射，对于实际应用来讲，<BR>对象一般指面向对象中的对象，关系指关系型数据库，对于我们具体的项目来说，就是将 java 中的<BR>对象与关系型数据库（ oracle ， mysql ）中的表联系起来。 </P>
<P align=left>ORM 解决方案有以下四部分组成： </P>
<P align=left>■ 在持续类的对象上执行基本的 CRUD 操作的一组 API 。 </P>
<P align=left>■ 用于指定查询的一种语言或一组 API ，这些查询会引用类和类属性。 </P>
<P align=left>■ 用于指定映射元数据的工具。 </P>
<P align=left>■ 实现 ORM 的一项技术，用来与事务对象交互以完成脏检查、懒关联存取和其它优化功能。 </P>
<P align=left>ORM 这种解决方案的好处： </P>
<P align=left>对底层的封装，因此，可移植性好，厂商独立； </P>
<P align=left>解决对象 - 关系不匹配问题； </P>
<P align=left> </P>
<P align=left>在传统我们在持久层通常使用 SQL 和 JDBC ，通常认为这样方式已经让大家感到厌倦了，特别是烦琐的代码； </P>
<P>2 、 hibernate 可以认为是最优秀的 ORM 工具 </P>
<P align=left>Hibernate 是一个雄心勃勃的项目，它的目标是成为 Java 中管理持续性数据问题的一种完 </P>
<P align=left>整的解决方案。它协调应用与关系数据库的交互，让开发者解放出来专注于手中的业务问题。 </P>
<P>Hibernate 符合 java 编程习惯，它把数据库与一个 POJO （简单 Java 对象）关联起来，<BR>使得对数据库进行 CRUD 等操作时候，直接操作 Java 对象就可以了。通过以前 Java Bean 一样 , <BR>使用 setter 和 getter 方法。 </P>
<P><FONT size=+1><STRONG>五、辅助工具</STRONG></FONT></P>
<P align=left><STRONG>(1)自动生成 hibernate 的映射文件</STRONG> </P>
<P align=left>一般考虑两个方向：从数据库到映射文件，从 java 类到映射文件 </P>
<P align=left>数据库到映射文件可以采用 Middlegen-Hibernate ，这个能很直观的看到表之间的关系，并且能适当的做修改； </P>
<P align=left>从 java 类到映射文件的生成，可以用 XDoclet ，不过需要在 java 类中加上一些标记 </P>
<P align=left>从生成的映射文件自动生成 java 类，可以用用一些工具，如 hbm2java </P>
<P>从这四种自动生成工具来看， &nbsp;mapping&nbsp;file,&nbsp;java&nbsp;file&nbsp;and&nbsp;DDL ，只要知道任何一种文件，都可以得到另外两种文件， </P>
<P>如： </P>
<P>1.&nbsp; 只有 mapping&nbsp;file: </P>
<P>mapping&nbsp;file---hbm2java----java---SchemaExport----DDL </P>
<P>2. 只有 DDL </P>
<P>DDL---Middlegen---hbm----hbm2java----java </P>
<P>3. 只有 Java </P>
<P>java---XDoclet---hbm----SchemaExport----DDL </P>
<P>从这里，大家也可以体会到 ,&nbsp;Hibernate 强大的灵活性 </P>
<P> </P>
<P><STRONG>不过我们通常习惯专门的工具设计数据库，譬如 power designer 等工具，会自动生成 DDL ，<BR>所以我们更需要通过 DDL ，就自动生成 Mapping file 和 java 类 </STRONG></P>
<P><STRONG>(2)在 Eclipse 开发工具中，有一个比较好用的插件 </STRONG></P>
<P>Hibernate Synchronizer </P>
<P>•&nbsp; 自动生成基本的 Hibernate 配置文件 </P>
<P>•&nbsp; 自动由表结构生成 POJO 类， XML Mapping 和基本的 DAO 类。 </P>
<P>•&nbsp; 精巧的继承结构将自动生成代码和用户定制的代码巧妙的分割开来。 </P>
<P>•&nbsp; 将自动生成的代码放在基类（ Base* ）中，将用户定制的代码放在子类中。分割了自动生成的代码和用户定制的代码。 </P>
<P>•&nbsp; 当表结构发生了变化时，插件只需要更改自己生成的基类，不用管用户定制的子类。用户定制的子类几乎不用改动，<BR>&nbsp;&nbsp;&nbsp;或只需要很少的改动即可适应新的表结构。</P>
<P align=left>另：在 hibernate 使用一个 sessionFactory 操作多个数据库时候，可以使用 </P>
<P align=left>public StatelessSession openStatelessSession(Connection connection); 方法 </P>
<P align=left>--------------------------------------------------------------------------------------</P>
<P align=left>路漫漫兮其修远兮，吾将上下而求索！</P>
<P align=left>不过对于hibernate的学习暂且告一段落，哈哈!</P><img src ="http://www.blogjava.net/danxy2008/aggbug/28437.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/danxy2008/" target="_blank">蒋利文</a> 2006-01-18 10:42 <a href="http://www.blogjava.net/danxy2008/articles/28437.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>