﻿<?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-爪哇东南的自留地</title><link>http://www.blogjava.net/ericli1982/</link><description>学习探讨开源和web开发</description><language>zh-cn</language><lastBuildDate>Sat, 18 Apr 2026 23:39:32 GMT</lastBuildDate><pubDate>Sat, 18 Apr 2026 23:39:32 GMT</pubDate><ttl>60</ttl><item><title>数码摄影中的光及用光技巧 </title><link>http://www.blogjava.net/ericli1982/archive/2006/10/02/73191.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Mon, 02 Oct 2006 06:32:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/10/02/73191.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/73191.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/10/02/73191.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/73191.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/73191.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 大家都知道，摄影是光的艺术！没有光线，就没有摄影；用光不当，就得不到一幅满意的照片。因此，光是摄影的基础，有了它，感光材料才有感光的可能；有了它，物体才能显现出形态、色彩和质感。												    布光，则是摄影中的一项创造性工作，它体现着一个摄影师的个性和风格，也关系到一幅作品的成败。																		    从某种意义上讲，不管是摄...&nbsp;&nbsp;<a href='http://www.blogjava.net/ericli1982/archive/2006/10/02/73191.html'>阅读全文</a><img src ="http://www.blogjava.net/ericli1982/aggbug/73191.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-10-02 14:32 <a href="http://www.blogjava.net/ericli1982/archive/2006/10/02/73191.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>数码摄影入门之六 名家名言</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/27/72288.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Wed, 27 Sep 2006 05:49:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/27/72288.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/72288.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/27/72288.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/72288.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/72288.html</trackback:ping><description><![CDATA[根据<br />美国摄影家维利·奎克的看法，几乎所有的人都能够通过应用一些基本法则，达到具有相当水平的摄影构图能力。为此，他提出了一些简单的方法。他认为，依据这些方法，任何人都能在短时间内学会拍出较好的照片。 <br /><p>有些人或许对构图有天赋。不过，根据美国摄影家维利·奎克的看法，几乎所有的人都能够通过应用一些基本法则，达到具有相当水平的摄影构图能力。为此，他提出了一些简单的方法。他认为，依据这些方法，任何人都能在短时间内学会拍出较好的照片。 </p><p>维利·奎克指出，摄影者最易犯的错误是拍摄点取得过高，与被摄体离得太远，致使画面出现各种各样与拍摄目的毫无关系的东西。</p><p align="center"><img height="215" src="http://article.pchome.net/00/01/03/62/amoxicilin105560631926564_1053430654[1].jpg" width="400" border="0" /></p><p>他说：“请记住，画家是 把东西画进画面，而摄影者则是从画面去掉一些东西。” 他说：“一张照片应该只有一个趣味中心，画面上不能有无用的东西。如果你对某个物体是否有助于画面抱有怀疑，你就应尽可能地把它放弃掉。” 这里就是人们常说的摄影是“减法的艺术”</p><p>奎克认为：“这并不是说，趣味中心非得准确地置于交叉点上不可。正因为如此，实际上趣味中心常出现在交叉点附近。” </p><p>奎克指出：“每一幅照片都应保持一定的平衡。这就是说，对主要被摄体的安排，不能使画、面出现向分量大的一边倾倒。但平衡并不意味着将两个同样大小和同等形状的东西置于对称的位置。这里的关系，只要你看一下在玩跷跷板的孩子就知道了。跷跷板两边的孩子，小些的一个必定坐在离中央远些的地方，而大的孩子肯定坐在靠近中央的地方。” </p><p align="center"><img height="209" src="http://article.pchome.net/00/01/03/62/amoxicilin1055606369conp[1].jpg" width="476" border="0" /></p><p>奎克认为：“把突出的线条安排，指向趣味中心，是拍摄一幅悦目照片的另一个要素。这些线条被称为主导线，有效地利用主导线，可以创造出惊人的照片。把主导线安排成对角线，会产生有力的动感。 </p><p>“线条常常在照片中提供一个边框。这可以通过选择视点来进行，例如在树下通过树枝框住画面上的被摄主体。此时通常使用小光圈，以使整幅照片清晰。这样做，也有可能使边框过于突出，但安排适当，会得到好照片。 <br />“在一幅照片中，地平线的位置会给人以强烈的印象。拍摄时，地平线要尽量避免处在照片的等比线上，因为这样做会把照片均分为两半，给人以呆板的感觉。 </p><p>地平线处在画面下方，会给人以宁静的感觉，而处于上方，给人的感觉则是活泼、有力的。 “此外，横幅画面可以产生安宁、平静的感觉，而竖直画面则会产生动态效果。” </p><p>奎克认为，以上方法如果运用得好，你的照片将会出现明显的改观，而且随着时间的推移，你很快就会学会鉴赏构图，从而为你增添摄影的乐趣。 <br /></p><div id="content"><p></p><p>达柯 认为，有时“如果线条与视觉产生了共鸣，一簇线条本身就能成为一个主体”。</p><p>美国摄影家L．小雅各希斯认为：“构图是从摄影者的心灵的眼睛做起的。构图的过程也被称为‘预见’，就是在未拍摄某一物体之前或正在拍摄的时候，就能在脑海中形成一个图像或印象。通过经常析自己和别人的作品的构图，就会使自己的这种预见本领更加娴熟，变成一种本能。”这就是我常说的用脑子拍照。</p><p align="center"><img height="397" src="http://article.pchome.net/00/01/03/62/amoxicilin1055606678gryz07-01-02[1].jpg" width="300" border="0" /></p><p align="center"><font size="2">线条构成画面</font></p><p>奥地利摄影家伊涅斯特·哈斯对此也有同感，对于构图，他己达到手中无剑，剑在心中的境界，他认为、“构图在于平衡，每个人对平衡的处理都各有不同。”正如同武功达到最高境界时，已没有招式名称，只凭自己的功力去化解。他认为：“你越能忘记你的器材，就越能集中你的题材和构图，这时相机只是你眼睛的延续，再没有其他意义。” 小雅各布斯还认为：“构图的最基本的因素是线条、形式、质感以及这些因素之间的空间。当然色彩同样也是不可忽略的因素。会聚的线条一般能说明透视关系，但并不是所有的照片都非要表现出透视的深度不可。许多杰出的作品都是平面图案。在取景器中的某个景物或人物的肖像，都是根据摄影者个人的感受进行安排的。就是所谓摄影里所有的控制是服务于你想表达的情绪。</p><p align="center"><img height="268" src="http://article.pchome.net/00/01/03/62/amoxicilin1055606733bleaf[1].jpg" width="400" border="0" /></p><p align="center"><font size="2">色彩的平衡很重要</font></p><p>“在大多数情况下，每幅照片中都有一个或一组形状或形式起主导作用，而照片中的色彩、体积、位置和其他形状等，都是为主导因素服务的。……构图中的对比，是指大与小、明与暗、近与远、主动与被动、平滑与粗糙、色彩的浓艳与轻淡等等的对比。要多利用这些相互对立的因素，通过它门使主体影响整个构图。例如，恰当地利用对比法则，照片就会具有强大的魅力。” </p><p>摄影家瓦尔特·德·格鲁伊特对摄影构图作阐述。他认为：“每一种构图都是以排列次序为基础的，就像我们从哥士达心理学和信息学原理中所了解到的那样，构图可以用多种方法获得。它产生于相似事物的组合以及对相反事物的强调。排列次序并不是千篇一律的，形态和色彩的疏密和对比也会产生排列次序。排列次序是以一种美学上的均衡为基础的，而均衡则从复杂、矛盾和动态之中造就和谐。”</p><p align="center"><img height="264" src="http://article.pchome.net/00/01/03/62/amoxicilin1055606941showpic[1].jpg" width="400" border="0" /></p><p align="center"><font size="2">线条的引导作用，所有的线条汇聚到中心主体</font></p><p>他说：“任何人，只要懂得把照片分成单个的构图成分，借以得出它在美学上的一致性和合理性来审查照片的具体效果，就都会成功地创作出好的作品。" </p><p>"要获得令人满意的照片构图，须经常分析照片。” 他提出的分析照片构图的最重要标准是： </p><p>1．人物和环境的关系以及反差情况。 2.照片所传递的信息的价值以及类似事物。 3．照明和纵深。4.突出的线条和照片的画幅。</p><p>对于如何获得较好的摄影构图，格鲁伊特提出了以下重要建议：</p><p>a．画面所提供的信息不能造成视觉上的混乱。 </p><p>b．人物和环境的关系要有助于传达照片的意图。 </p><p>c．应当避免由于人物和环境之间的含糊关系而可能产生的错觉。</p><p>d．明与暗的关系或者彩色对比的关系是非常重要的。 </p><p>e．除了人物和环境在形式上的关系之外，对人物和环境的心理上的权衡也是 十分重要的，因为每个视觉印象都立即作出喜欢或不喜欢的判断。无偏好的估价意味着根本没有反应。 </p><p align="center"><img height="300" src="http://article.pchome.net/00/01/03/62/amoxicilin1055607425jiasm2[1].jpg" width="400" border="0" /></p><p align="center"><font size="2">茉莉mm的“光绘”</font></p><p>f．表现与我们熟悉的物体相类似的东西，使人容易辨认，从而能比较迅速地予以理解。因此，重复内容是必要的。</p><p>g．照片的复杂程度一定不能太低(感官刺激不够)，也不能太高(感官刺激过分) </p><p>h．每个人对每幅照片的美学评价总是不一样的，而且这种评价是受感情支配的。它在很大程度上取决于观众的认识，他的经历和他的敏感性。 </p><p>i．形式主义和时髦风尚是不能持久的。这种缺乏独创性的缺点，是不可能用技术补偿的。 </p><p>j．照明、透视、重叠和影纹的层次变化，有助于在二维空间的平面上体现出明显的纵深感。</p><p>k．不寻常的透视效果，有助于使照片生动活泼。 </p><p>l．有意识地使用突出的方向线和选择适合主体的画幅，会加强照片的效果。</p><p>更多名家名言和作者发表的个人看法，请访问：</p></div><img src ="http://www.blogjava.net/ericli1982/aggbug/72288.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-27 13:49 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/27/72288.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一些摄影方面的术语</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/25/71751.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Mon, 25 Sep 2006 07:00:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/25/71751.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/71751.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/25/71751.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/71751.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/71751.html</trackback:ping><description><![CDATA[
		<span class="dczttxt04 style4">
				<span class="dczttxt04 style6">
						<span class="style7">CCD:<br />中文译为"电子耦合组件"(charged coupled device)，它就像传统相机的底片一样，是感应光线的电路装置，可以将它想象成一颗颗微小的感应粒子，铺满在光学镜头后方，当光线与图像从镜头透过、投射到ccd表面时，ccd就会产生电流，将感应到的内容转换成数码资料储存起来。ccd的尺寸其实是说感光器件的面积大小,ccd像素数目越多、单一像素尺寸越大，捕获的光子越多，感光性能越好，信噪比越低,收集到的图像就会越清晰。因此，尽管ccd数目并不是决定图像品质的唯一重点，我们仍然可以把它当成相机等级的重要判准之一。 <br /><span class="dczttxt04 style4"><span class="dczttxt04 style6"><span class="style7"><br />CMOS: <br />互补性氧化金属半导体CMOS（Complementary Metal-Oxide Semiconductor）和CCD一样同为在数码相机中可记录光线变化的半导体。CMOS的制造技术和一般计算机芯片没什么差别，主要是利用硅和锗这两种元素所做成的半导体，使其在CMOS上共存着带N（带–电） 和 P（带+电）级的半导体，这两个互补效应所产生的电流即可被处理芯片纪录和解读成影像。同样，CMOS的尺寸大小影响感光性能的效果，面积越大感光性能越好。CMOS的缺点就是太容易出现杂点, 这主要是因为早期的设计使CMOS在处理快速变化的影像时，由于电流变化过于频繁而会产生过热的现象。<br /><span class="dczttxt04 style4"><span class="dczttxt04 style6"><span class="style7">光学变焦倍数:光学变焦是依靠光学镜头结构来实现变焦，变焦方式与35mm相机差不多，就是通过摄像头的镜片移动来放大与缩小需要拍摄的景物，光学变焦倍数越大，能拍摄的景物就越远。如今的数码相机的光学变焦倍数大多在2倍－5倍之间，也有一些码相机拥有10倍的光学变焦效果。而家用摄像机的光学变焦倍数在10倍-25倍，能比较清楚地拍到70米外的东西。<br /><span class="dczttxt04 style4"><span class="dczttxt04 style6"><span class="style7"><br />光圈:<br />光圈英文名称为Aperture，光圈是一个用来控制光线透过镜头，进入机身内感光面的光量的装置，也是相机一个极其重要的指标参数，它通常是在镜头内。它的大小决定着通过镜头进入感光元件的光线的多少。表达光圈大小我们是用F值。光圈F值 = 镜头的焦距 / 镜头口径的直径从以上的公式可知要达到相同的光圈F值，长焦距镜头的口径要比短焦距镜头的口径大。<br /><br />    我们平时所说的光圈值F2.8、F8、F16等是光圈“系数”，是相对光圈，并非光圈的物理孔径，与光圈的物理孔径及镜头到感光器件（胶片或CCD或CMOS）的距离有关。<br /><br />    当光圈物理孔径不变时，镜头中心与感光器件距离愈远，F数愈小，反之，镜头中心与感光器件距离愈近，通过光孔到达感光器件的光密度愈高，F数就愈大。完整的光圈值系列如下： F1， F1.4， F2， F2.8， F4， F5.6， F8， F11， F16， F22， F32， F44， F64。<br /><br /><span class="dczttxt04 style4"><span class="dczttxt04 style6"><span class="style7">噪点:<br /></span></span></span>噪点产生的原因：<br /><br />1、长时间曝光产生的图像噪音<br /><br />    这种现像主要大部分出现在拍摄夜景，在图像的黑暗的夜空中，出线了一些孤立的亮点。可以说其原因是由于CCD无法处理较慢的快门速度所带来的巨大的工作量，致使一些特定的像素失去控制而造成的。为了防止产生这种图像噪音，部分数码相机中配备了被称为"降噪"的功能。 <br /><br />    如果使用降噪功能，在记录图像之前就会利用数字处理方法来消除图像噪音，因此在保存完毕以前就需要花费一点额外的时间。<br /><br />2、用JPEG格式对图像压缩而产生的图像噪音<br /><br />    由于JPEG格式的图像在缩小图像尺寸后图像仍显得很自然，因此就可以利用特殊的方法来减小图像数据。此时，它就会以上下左右8×8个像素为一个单位进行处理。因此尤其是在8×8个像素边缘的位置就会与下一个8×8个像素单位发生不自然的结合。 <br /><br />    由JPEG格式压缩而产生的图像噪音也被称为马赛克噪音（Block Noise），压缩率越高，图像噪音就越明显。 <br /><br />    虽然把图像缩小后这种噪音也会变得看不出来，但放大打印后，一进行色彩补偿就表现得非常明显。这种图像噪音可以通过利用尽可能高的画质或者利用JPEG格式以外的方法来记录图像而得以解决。<br /><br />3、模糊过滤造成的图像噪音<br /><br />    模糊过滤造成的图像噪音和JPEG一样，在对图像进行处理时造成的图像噪音。有时是在数码相机内部处理过程中产生的，有时是利用图像润色软件进行处理时产生的。对于尺寸较小的图像，为了使图像显得更清晰而强调其色彩边缘时就会产生图像噪音。 <br /><br />    所谓的清晰处理就是指数码相机具有的强调图像色彩边缘的功能和图像编辑软件的“模糊过滤（Unsharp Mask）”功能。在不同款式的数码相机中也有一些相机会对整个图像进行色彩边缘的强调。而处理以后就会在原来的边缘外侧出现其他颜色的色线。 <br /><br />   如果将图像尺寸缩小以后用于因特网的话，图像不是总觉得会变得模糊不清吗？此时如果利用“模糊过滤”功能对图像进行清晰处理，图像看起来效果就会好一些。不过由于产生了图像噪音，在进行第二次或第三次处理时，这种图像噪音就显得很麻烦。切忌不要因为处理过度而使图像显得过于粗糙。 <br /><br />    这里值得一题的是光圈F值愈小，在同一单位时间内的进光量便愈多，而且上一级的进光量刚是下一级的一倍，例如光圈从F8调整到F5.6，进光量便多一倍，我们也说光圈开大了一级。多数非专业数码相机镜头的焦距短、物理口径很小，F8时光圈的物理孔径已经很小了，继续缩小就会发生衍射之类的光学现象，影响成像。所以一般非专业数码相机的最小光圈都在F8至F11，而专业型数码相机感光器件面积大，镜头距感光器件距离远，光圈值可以很小。对于消费型数码相机而言，光圈F值常常介于F2.8 - F16。此外许多数码相机在调整光圈时，可以做1/3级的调整。 </span></span></span></span></span></span></span></span></span></span>
				</span>
		</span>
<img src ="http://www.blogjava.net/ericli1982/aggbug/71751.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-25 15:00 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/25/71751.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SQL优化原则</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/13/69459.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Wed, 13 Sep 2006 12:25:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/13/69459.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/69459.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/13/69459.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/69459.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/69459.html</trackback:ping><description><![CDATA[
		<p>
				<br /> SQL优化原则<br />  <br />1、使用索引来更快地遍历表。 <br />缺省情况下建立的索引是非群集索引，但有时它并不是最佳的。在非群集索引下，数据在物理上随机存放在数据页上。合理的索引设计要建立在 <br />对各种查询的分析和预测上。一般来说： <br />a.有大量重复值、且经常有范围查询（ &gt; ,&lt; ，&gt; =,&lt; =）和order by、group by发生的列，可考 <br />虑建立群集索引； <br />b.经常同时存取多列，且每列都含有重复值可考虑建立组合索引； <br />c.组合索引要尽量使关键查询形成索引覆盖，其前导列一定是使用最频繁的列。索引虽有助于提高性能但不是索引越多越好，恰好相反过多的索引会导致系统低效。用户在表中每加进一个索引，维护索引集合就要做相应的更新工作。 <br />2、在海量查询时尽量少用格式转换。 <br />3、ORDER BY和GROPU BY使用ORDER BY和GROUP BY短语，任何一种索引都有助于SELECT的性能提高。 <br />7、任何对列的操作都将导致表扫描，它包括数据库函数、计算表达式等等，查询时要尽可能将操作移至等号右边。 <br />4、IN、OR子句常会使用工作表，使索引失效。如果不产生大量重复值，可以考虑把子句拆开。拆开的子句中应该包含索引。 </p>
		<p>Sql的优化原则2： <br />1、只要能满足你的需求，应尽可能使用更小的数据类型：例如使用MEDIUMINT代替INT <br />2、尽量把所有的列设置为NOT NULL，如果你要保存NULL，手动去设置它，而不是把它设为默认值。 <br />3、尽量少用VARCHAR、TEXT、BLOB类型 <br />4、如果你的数据只有你所知的少量的几个。最好使用ENUM类型 <br />5、正如graymice所讲的那样，建立索引。 <br />以下是我做的一个实验，可以发现索引能极大地提高查询的效率： </p>
		<p>我有一个会员信息表users，里边有37365条用户记录： </p>
		<p>在不加索引的时候进行查询： <br />sql语句A: <br />select * from users where username like ’%许%’; <br />在Mysql-Front中的8次查询时长为：1.40,0.54,0.54,0.54,0.53,0.55,0.54 共找到960条记录 </p>
		<p>sql语句B: <br />select * from users where username like ’许%’; <br />在Mysql-Front中的8次查询时长为：0.53,0.53,0.53,0.54,0.53,0.53,0.54,0.54 共找到836条记录 </p>
		<p>sql语句C: <br />select * from users where username like ’%许’; <br />在Mysql-Front中的8次查询时长为：0.51,0.51,0.52,0.52,0.51,0.51,0.52,0.51 共找到7条记录 </p>
		<p>为username列添加索引: <br />create index usernameindex on users(username(6)); </p>
		<p>再次查询： <br />sql语句A: <br />select * from users where username like ’%许%’; <br />在Mysql-Front中的8次查询时长为：0.35,0.34,0.34,0.35,0.34,0.34,0.35,0.34 共找到960条记录 </p>
		<p>sql语句B: <br />select * from users where username like ’许%’; <br />在Mysql-Front中的8次查询时长为：0.06,0.07,0.07,0.07,0.07,0.07,0.06,0.06 共找到836条记录 </p>
		<p>sql语句C: <br />select * from users where username like ’%许’; <br />在Mysql-Front中的8次查询时长为：0.32,0.31,0.31,0.32,0.31,0.32,0.31,0.31 共找到7条记录 </p>
		<p>在实验过程中，我没有另开任何程序，以上的数据说明在单表查询中，建立索引的可以极大地提高查询速度。 <br />另外要说的是如果建立了索引，对于like ’许%’类型的查询，速度提升是最明显的。因此，我们在写sql语句的时候也尽量采用这种方式查询。 </p>
		<p>对于多表查询我们的优化原则是： </p>
		<p>尽量将索引建立在：left join on/right join on ...　＋条件，的条件语句中所涉及的字段上。 </p>
		<p>多表查询比单表查询更能体现索引的优势。 </p>
		<p>6、索引的建立原则： <br />如果一列的中数据的前缀重复值很少，我们最好就只索引这个前缀。Mysql支持这种索引。我在上面用到的索引方法就是对username最左边的6个字符进行索引。索引越短，占用的 </p>
		<p>磁盘空间越少，在检索过程中花的时间也越少。这方法可以对最多左255个字符进行索引。 </p>
		<p>在很多场合，我们可以给建立多列数据建立索引。 </p>
		<p>索引应该建立在查询条件中进行比较的字段上，而不是建立在我们要找出来并且显示的字段上 </p>
		<p>7、限制索引的使用的避归。<br />7.1  IN、OR子句常会使用工作表，使索引失效。<br />如果不产生大量重复值，可以考虑把子句拆开。拆开的子句中应该包含索引。这句话怎么理解决，请举个例子 </p>
		<p>例子如下: <br />如果在fields1和fields2上同时建立了索引，fields1为主索引 <br />以下sql会用到索引 <br />select * from tablename1 where fields1=’value1’ and fields2=’value2’ <br />以下sql不会用到索引 <br />select * from tablename1 where fields1=’value1’ or fields2=’value2’ <br />7.2 使用IS NULL 或IS NOT NULL<br />         使用IS NULL 或IS NOT NULL同样会限制索引的使用。因为NULL值并没有被定义。在SQL语句中使用NULL会有很多的麻烦。因此建议开     发人员在建表时，把需要索引的列设成NOT NULL。如果被索引的列在某些行中存在NULL值，就不会使用这个索引（除非索引是一个位图索引，关于位图索引在稍后在详细讨论）。</p>
		<p>7.3 使用函数<br />如果不使用基于函数的索引，那么在SQL语句的WHERE子句中对存在索引的列使用函数时，会使优化器忽略掉这些索引。下面的查询不会使用索引（只要它不是基于函数的索引）<br />   select empno,ename,deptno<br />          from   emp<br />          where  trunc(hiredate)='01-MAY-81';<br />          把上面的语句改成下面的语句，这样就可以通过索引进行查找。<br />          select empno,ename,deptno<br />          from   emp<br />          where  hiredate&lt;(to_date('01-MAY-81')+0.9999);</p>
		<p>7.4 比较不匹配的数据类型<br />比较不匹配的数据类型也是比较难于发现的性能问题之一。注意下面查询的例子，account_number是一个VARCHAR2类型，在account_number字段上有索引。下面的语句将执行全表扫描。<br />         select bank_name,address,city,state,zip<br />         from   banks<br />         where  account_number = 990354;<br />         Oracle可以自动把where子句变成to_number(account_number)=990354，这样就限制了索引的使用,改成下面的查询就可以使用索引：<br />         select bank_name,address,city,state,zip<br />         from   banks<br />         where  account_number ='990354';<br />     特别注意：不匹配的数据类型之间比较会让Oracle自动限制索引的使用，即便对这个查询执行Explain Plan也不能让您明白为什么做了一               次“全表扫描”。</p>
		<p>补充: <br />1.索引带来查询上的速度的大大提升,但索引也占用了额外的硬盘空间(当然现在一般硬盘空间不成问题),而且往表中插入新记录时索引也要随着更新这也需要一定时间. <br />有些表如果经常insert,而较少select,就不用加索引了.不然每次写入数据都要重新改写索引,花费时间; <br />这个视实际情况而定,通常情况下索引是必需的. <br />2.我在对查询效率有怀疑的时候,一般是直接用Mysql的Explain来跟踪查询情况. <br />你用Mysql-Front是通过时长来比较,我觉得如果从查询时扫描字段的次数来比较更精确一些.</p>
		<p> </p>
		<p> </p>
<img src ="http://www.blogjava.net/ericli1982/aggbug/69459.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-13 20:25 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/13/69459.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>取当前日期 到 前３个月的sql记录 怎么写</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/13/69458.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Wed, 13 Sep 2006 12:24:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/13/69458.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/69458.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/13/69458.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/69458.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/69458.html</trackback:ping><description><![CDATA[
		<p>select * from t where 日期字段名字&gt;DATEADD ( mm, -3, getdate()) </p>
		<p>//t 是你的表名</p>
		<p> </p>
		<p> </p>
		<p>
				<br />现在程序里得到当前时间和3个月前的时间<br />Date nowDate=new Date();<br />Date oldDate=new Date();<br />oldDate.setMonth(oldDate.getMonth()-3);</p>
		<p>select * from tab where 日期字段&gt;oldDate and 日期字段&lt;newDate</p>
<img src ="http://www.blogjava.net/ericli1982/aggbug/69458.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-13 20:24 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/13/69458.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts初始化</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/13/69457.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Wed, 13 Sep 2006 12:24:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/13/69457.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/69457.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/13/69457.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/69457.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/69457.html</trackback:ping><description><![CDATA[
		<p>我在几个月前曾经发表过一个帖子，就是和大家一起学习struts源代码。成为一名合格的程序员，阅读大量的优秀程序是必不可少的。只看书是不会让你水平有很大提高的，要多看多写。<br />本来是打算等下面几篇文章写好后一起发布的，这样大家可能才能看得明白些，但是根据我现在的状况，估计还要一、两个月。所以，为了防止在struts源代码发生过大变化后我的文章就没有太大价值了，所以就提前发表了，霍霍~~~<br />我的email为：<a href="mailto:mariah_fan@hotmail.com">mariah_fan@hotmail.com</a>，有什么不对的地方请大家指正：）<br />struts作为J2EE的MVC框架已经取得了很大的成功，下面将分几篇文章说明struts源程序的结构。<br />第一篇  struts的初始化</p>
		<p>struts 的核心类是org.apache.struts.action.ActionServlet，这个类将会在struts第一次使用时，<br />作为servlet初始化并存入tomcat容器。很显然的，初始化将会调用init方法初始化相应的数据。</p>
		<p>一、initInternal()方法：<br />    通过调用MessageResources.getMessageResources(internalName)方法生成一个<br />    MessageResources类，getMessageResources是通过调用MessageResourcesFactory.<br />    createResources(config)来实现的。至于MessageResourcesFactory是一个abstract类，任何<br />    继承自它的类都要实现createResources方法，生成MessageResources对象。整个程序生成<br />    MessageResourcesFactory使用了如下技巧：<br />    MessageResourcesFactory.factoryClass = factoryClass;<br />    MessageResourcesFactory.clazz = null;<br />    首先会通过factoryClass来定义一个类全名，然后通过ClassLoader.loadClass<br />    (factoryClass)方法来生成这个类，并赋给clazz，然后通过newInstance来生成一个对象。<br />    在本程序中，生成MessageResources对象实际就是对如下属性进行了初始化：<br />    this.factory = factory;("org.apache.struts.util.PropertyMessageResourcesFactory")<br />    this.config = config;("org.apache.struts.action.ActionResources")<br />    this.returnNull = returnNull;(true/false)</p>
		<p>    对于MessageResources类的作用是根据不同的Locate来格式化相应的string。或者把你需要改变<br />    的string存放到数组中，然后通过getMessage(Locale locale, String key, Object args[])<br />    方法来格式化。然后把格式好的string存放到HashMap里，这样就可以为以后重用。这里的key是<br />    使用的locale.toString() + "." + key</p>
		<p>    在PropertyMessageResources中的loadLocale方法用来读取resource的初始化信息。首先它会<br />    通过一个HashMap检测这个localKey相关的message是否已经被初始化了，如果被初始化过就跳<br />    出，检测的方法是locales.get(localeKey) != null。<br />    然后会读取如下一个文件：<br />    org/apache/struts/action/ActionResources_(localKey).properties，然后进行如下操作：<br />    Properties props = new Properties();<br />    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();<br />    is = classLoader.getResourceAsStream(name);<br />    props.load(is);<br />    Iterator names = props.keySet().iterator();<br />        while (names.hasNext()) {<br />            String key = (String) names.next();<br />            if (log.isTraceEnabled()) {<br />                log.trace("  Saving message key '" + messageKey(localeKey, key));<br />            }<br />            messages.put(messageKey(localeKey, key), props.getProperty(key));<br />    }</p>
		<p>    PropertyMessageResources 就是通过上面的loadLocale方法查找与Locale locale, String key<br />    相对对应的Message.查找的次序如下locale.toString()，然后是<br />    localeKey = localeKey.substring(0, underscore)，然后是defaultLocale，然后是key。</p>
		<p>    最后，resource类的结构如下：<br />    PropertyMessageResources extends MessageResources<br />    PropertyMessageResourcesFactory extends MessageResourcesFactory</p>
		<p>二、initOther()方法：<br />    从servlet中获取config和debug两个参数，然后初始化ConvertUtils对象。由于<br />    ConvertUtils.deregister()的初始化，所有的Converter都是有初始值的，所以这里Struts自己<br />    把这些初始值设置为null，即转换出错的时候返回null，而不是初始值。使用ConvertUtils类的<br />    原因是由于从form传输过来的都是String类型的值，所以我们要把它们转换成相应的类型。</p>
		<p>    提到几个技巧：<br />    *public boolean isIndexed() {<br />         if (type == null) {<br />             return (false);<br />         //技巧一：判断是否是一个Array类的方法<br />         } else if (type.isArray()) {<br />             return (true);<br />         //技巧二：判断type是否是List的一个父类或者父接口，或者与List为同一个类<br />         //要注意如果List是另一个primitive的TYPE类，那么type必须也是这个类才会<br />         //返回true，否则都是false。注意long.TYPE与Long.class是不同的<br />         } else if (List.class.isAssignableFrom(type)) {<br />             return (true);<br />         } else {<br />            return (false);<br />         }<br />     }</p>
		<p>    *//componentType为Array类所存储的元素的类别 <br />     Class componentType = indexedProperty.getClass().getComponentType();<br />     //生成一个新的Array<br />     Object newArray = Array.newInstance(componentType, (index + 1));<br />     System.arraycopy(indexedProperty, 0, newArray, 0, length);<br />     indexedProperty = newArray;<br />     set(name, indexedProperty);<br />     int newLength = Array.getLength(indexedProperty);<br />     for (int i = length; i &lt; newLength; i++) {<br />        Array.set(indexedProperty, i, createProperty(name+"["+i+"]", componentType));<br />     }</p>
		<p>三、initServlet()方法：<br />    这个方法主要是通过digester类解析web.xml，对String servletMapping属性进行初始化。对于<br />    digester说明如下：这是一个基于DOM的SAX实现的类，它是事件触发的，根据xml文件的结构，<br />    每次读到一个节点元素就会触发一个事件。</p>
		<p>    InputStream input = getServletContext().getResourceAsStream("/WEB-INF/web.xml");<br />    这是一个比较少见的方法。首先通过this.servletName = getServletConfig().<br />    getServletName()获取servlet的名称，然后根据<br />    if (servletName.equals(this.servletName)) {<br />        this.servletMapping = urlPattern;<br />    }<br />    来判断当前读到的servlet名称是否是我们运行的servlet的名称，如果是，就把url-pattern作为<br />    我们的servletMapping。</p>
		<p>四、getServletContext().setAttribute(Globals.ACTION_SERVLET_KEY, this)<br />    把自己存储到servletContext中，属性名为Globals.ACTION_SERVLET_KEY。</p>
		<p>五、ModuleConfig moduleConfig = initModuleConfig("", config)<br />    这个方法使用由initOther()方法获取的config值为要解析的xml路径，用来初始化ModuleConfig。<br />    它首先采用与生成MessageResourcesFactory同样的方法产生一个MessageResourcesFactory对象：<br />    MessageResourcesFactory为一个抽象类，每一个继承它的类都要实现<br />    createModuleConfig(String prefix)方法。本程序使用的缺省的MessageResourcesFactory类为<br />    org.apache.struts.config.impl.DefaultModuleConfigFactory，它<br />    的createModuleConfig(String prefix)方法会生成一个ModuleConfigImpl类。</p>
		<p>    ModuleConfigImpl类相当于一个JavaBean，用来存放一个web模块运行时所需要的配置信息。当<br />    然，一个web模块可以拥有多个ModuleConfig，但是缺省的是prefix长度为0的ModuleConifg。它<br />    的每个属性几乎都是由HashMap组成的，它通过一个configured布尔值来描述当前的ModuleConfig<br />    是否已经被初始化完毕，在每存放一个属性的时候都会监测这个值。如果初始化完毕而还要改变<br />    里面的属性值，则会报出IllegalStateException("Configuration is frozen")异常，现在对它<br />    的属性简单说明如下：<br />    * protected HashMap actionConfigs：<br />      这个HashMap用来存储ActionConfig对象。<br />    * protected HashMap dataSources<br />      这个HashMap用来存储DataSourceConfig对象。<br />    * protected HashMap exceptions<br />      这个HashMap用来存储ExceptionConfig对象。<br />    * protected HashMap formBeans<br />      这个HashMap用来存储FormBeanConfig对象。<br />    * protected HashMap forwards<br />      这个HashMap用来存储ForwardConfig对象。<br />    * protected HashMap messageResources<br />      这个HashMap用来存储MessageResourcesConfig对象。<br />    * protected ArrayList plugIns<br />      这个HashMap用来存储PlugInConfig对象。<br />    * protected ControllerConfig controllerConfig<br />      ControllerConfig类<br />    * protected boolean configured<br />      标志这个ModuleConfig是(true)否(false)配置完成。<br />    * protected String prefix<br />      用来标志和区分ModuleConfig类，同时在使用上面的config类初始化相应的资源以后，也是通<br />      过这个prefix来区分所属的不同的web模块。<br />    * protected String actionMappingClass = "org.apache.struts.action.ActionMapping"<br />      ActionMapping类名，缺省为org.apache.struts.action.ActionMapping。</p>
		<p>    初始化ModuleConfig的方法如下：<br />    首先是使用getServletConfig().getInitParameter("mapping")来获取设定的ActionMapping类<br />    名，然后通过initConfigDigester()方法来生成一个digester。最后用","分隔config，对每一<br />    块调用parseModuleConfigFile(prefix, paths, config, digester, path)方法解析。注意，这<br />    个方法实际上只有两个参数是有意义的：path为我们要解析的xml文件，config用来初始化完成<br />    后保存到servletContext中。</p>
		<p>    如果ModuleConfig中存放的FormBeanConfig为Dydamic类型，那么就调用<br />    DynaActionFormClass.createDynaActionFormClass(FormBeanConfig)初始化<br />    DynaActionFormClass，并存放到DynaActionFormClass.dynaClasses 的 static HashMap中。这<br />    里的key为FormBeanConfig.getName() + moduleConfig.getPrefix()。<br />    <br />    如果当前的ModuleConfig为缺省的ModuleConfig，那么将会调用如下几个方法：<br />    defaultControllerConfig(config)<br />    defaultMessageResourcesConfig(config)<br />    defaultFormBeansConfig(config)<br />    defaultForwardsConfig(config)<br />    defaultMappingsConfig(config)<br />    在struts1.1以后，这个特例将会被废弃：</p>
		<p>    defaultControllerConfig(config)为ControllerConfig通过getInitParameter(s)方法初始化如<br />    下几个属性：bufferSize，content，locale(true/false)，maxFileSize，nocache(true/false)<br />    ，multipartClass，tempDir。</p>
		<p>    defaultMessageResourcesConfig(config)为MessageResourcesConfig通过getInitParameter(s)<br />    方法初始化如下几个属性：application，factory，null(true/false)。</p>
		<p>    其它的几个方法就是获取不同的对象，然后把它们相应的存储到servlet中。关心如下：<br />    ActionFormBeans=&gt;FormBeanConfig，ActionForwards=&gt;ForwardConfig，<br />    ActionMappings=&gt;ActionConfig。</p>
		<p>六、initModuleMessageResources(ModuleConfig config)<br />    通过存储在ModuleConfig中的MessageResourcesConfig对象，逐个初始化MessageResource，<br />    然后再把初始化好的MessageResources存放到ServletContext中，attributeName为<br />    MessageResourcesConfig.getKey() + ModuleConfig.getPrefix()。</p>
		<p>七、initModuleDataSources(ModuleConfig config)<br />    通过存储在ModuleConfig中的DataSourceConfig对象，逐个初始化DataSource。然后对于每一个<br />    DateSource通过BeanUtils.populate(ds, dscs[i].getProperties())方法初始化其属性。再把初<br />    始化好的DateSource存放到ServletContext中，attributeName为<br />    DataSourceConfig.getKey() + ModuleConfig.getPrefix()。同时也存放到名位dataSources的<br />    FastHashMap中，key为DataSourceConfig.getKey()。</p>
		<p>    这里还会根据生成的DateSource对象是否是GenericDataSource类型，如果是则调用<br />    GenericDataSource.open()方法。GenericDataSource是一个非常简单的数据库连接池，它的<br />    open()方法用来初始化连接池，生成最小数目的GenericConnection，这里的open()方法根据<br />    String driver变量是否为null来判断是否已经被初始化过。需要仔细说明的是getConnection()<br />    方法，它首先从连接池中取出GenericConnection对象，然后检查其是否是可链接的，如果是就<br />    返回，否则继续取出，同时activeCount-1。如果没有取到，则会检查当前可使用的<br />    GenericConnection是否达到最大值(activeCount &lt; maxCount)，如果没有，调用<br />    createConnection()方法声成一个新的GenericConnection，然后检查其是否是可链接，如果可以<br />    则返回。returnConnection(GenericConnection conn)方法则是通过把GenericConnection放回到<br />    连接池，然后activeCount-1。</p>
		<p>    这个方法中使用到了ServletContextWriter类，DateSource的log信息就通过这个类写入。对这个<br />    类说明如下：<br />    它继承自PrintWriter，而PrintWriter又继承自Writer。Writer类所作的事情就是在同步的情况下<br />    调用abstract方法：abstract public void write(char cbuf[], int off, int len)，这个方法<br />    将会根据调用者的需要由调用者实现。<br />    PrintWriter则首先通过ensureOpen()方法检验这个类中是否有写入的对象(Writer类或其子类)，<br />    如果有则根据不同的情况调用这个写入对象的write方法(out.write(....))。这个类的print(...)<br />    方法就是据不同的情况调用相应的write(...)方法。而println(...)与之的区别就是每次多写入一<br />    个换行字符串。还有一个区别是println(...)会根据是否需要autoflush进行flush，而write(...)<br />    方法不会。<br />    ServletContextWriter类的作用是把字符写入ServletContext中。ServletContextWriter类方法中<br />    真正实现了write方法：<br />    public void write(char c) {<br />        if (c == '\n')<br />            flush();<br />        else if (c != '\r')<br />            buffer.append(c);<br />    }<br />    public void flush() {<br />        if (buffer.length() &gt; 0) {<br />            context.log(buffer.toString());<br />            buffer.setLength(0);<br />        }<br />    }</p>
		<p>八、initModulePlugIns(moduleConfig)<br />    通过存储在ModuleConfig中的PlugInConfig对象，逐个初始化PlugIn对象，存放到一个数组中，<br />    然后再把这个数组存放到ServletContext中，attributeName为<br />    Globals.PLUG_INS_KEY + ModuleConfig.getPrefix()。</p>
		<p>    对每一个生成的PlugIn对象通过<br />    BeanUtils.populate(plugIns[i], plugInConfigs[i].getProperties())方法初始化其属性。然后<br />    再把PlugInConfig对象存放到由其生成的PlugIn对象中。</p>
		<p>    最后，通过plugIns[i].init(this, (ModuleConfig) config)初始化这个plugIn对象。</p>
		<p>九、初始化结束<br />    完成了这个初始化以后，会调用ModuleConfig.freeze()令这个ModuleConfig变得不可改变。然后<br />    会遍历ServletConfig中的initParameterNames，如果有以"config/"开头的，则通过这个parameter<br />    的值继续初始化其它的ModuleConfig，且这个ModuleConfig的prefix为"config/"后的字符串。<br />    <br />    同样调用如下方法：<br />    initModuleMessageResources(moduleConfig);<br />    initModuleDataSources(moduleConfig);<br />    initModulePlugIns(moduleConfig);<br />    moduleConfig.freeze();</p>
		<p>    最后调用destroyConfigDigester()释放内存。</p>
<img src ="http://www.blogjava.net/ericli1982/aggbug/69457.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-13 20:24 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/13/69457.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts1.1源码解析</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/13/69455.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Wed, 13 Sep 2006 12:23:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/13/69455.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/69455.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/13/69455.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/69455.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/69455.html</trackback:ping><description><![CDATA[
		<p>Struts1.1b3部分源代码分析. <br />作者：     文章来源：<br />访问次数： 次    加入时间：2006-05-12 <br /> <br />Struts1.1部分源代码分析<br />一：说明<br />本文针对Struts1.1b3做分析，主要希望通过对源代码的分析阐述Struts1.1的工作方式。<br />本文不适合初学者参考，适合具有一定基于Struts开发的程序员参考。<br />下面的描述；里面将会对ActionServlet,RequestProcessor,ModuleConfig等几个类做一些<br />说明。以注释源代码的方式，说明取工作流程。<br />特别申明：Struts1.1代码版权属于Apache遵循The Apache Software License, Version 1.1.<br />本文版权属于孤魂一笑个人所有，任何个人或组织希望转载，请与我联系。并获得我的授权<br />方可转载。</p>
		<p>二：ActionServlet分析<br />我们先来看一下使用Struts的配置文件。</p>
		<p>
				<br />action<br />org.apache.struts.action.ActionServlet </p>
		<p>
				<br />definitions-config<br />/WEB-INF/tiles-defs.xml,/WEB-INF/tiles-tests-defs.xml,/WEB-INF/tiles-tutorial-defs.xml,<br />/WEB-INF/tiles-examples-defs.xml</p>
		<p>
				<br />definitions-debug<br />0</p>
		<p>
				<br />definitions-parser-details<br />0</p>
		<p>
				<br />definitions-parser-validate<br />true</p>
		<p> </p>
		<p>config<br />/WEB-INF/struts-config.xml</p>
		<p> </p>
		<p>config/examples<br />/WEB-INF/struts-examples-config.xml</p>
		<p> </p>
		<p>config/test<br />/WEB-INF/struts-tests-config.xml</p>
		<p> </p>
		<p>config/tutorial<br />/WEB-INF/struts-tutorial-config.xml</p>
		<p>
				<br />validate<br />true</p>
		<p>
				<br />debug<br />2</p>
		<p>
				<br />detail<br />2</p>
		<p> </p>
		<p>application<br />org.apache.struts.webapp.tiles.dev1-1.ApplicationResources</p>
		<p>
				<br />2</p>
		<p> </p>
		<p>
				<br />action<br />*.do</p>
		<p> </p>
		<p>接下来我们来看一下ActionServlet的具体使用<br />javax.servlet.http.HttpServlet<br />|<br />|--&gt;org.apache.struts.action.ActionServlet<br />所以本质上ActionServlet是一个普通的servlet，负责处理.do为后缀的Http请求.<br />servlet在执行doGet(),doPost(),之前先调用init(),<br />以下我们先分析一下init()方法<br />/**<br />* Initialize this servlet. Most of the processing has been factored into<br />* support methods so that you can override particular functionality at a<br />* fairly granular level.</p>
		<p>* servlet初始化操作,注意初始化顺序<br />* @exception ServletException if we cannot configure ourselves correctly<br />*/<br />public void init() throws ServletException {<br />//注意初始化的顺序<br />//Initialize our internal MessageResources bundle<br />initInternal();<br />//Initialize other global characteristics of the controller servlet<br />//处理一些全局变量的设置如：debug，detail等<br />initOther();<br />//Initialize the servlet mapping under which our controller servlet<br />//is being accessed. This will be used in the &amp;html:form&gt;<br />//tag to generate correct destination URLs for form submissions<br />//主要是注册DTD文件以及解析web.xml关于ActionServlet的配置。如后缀名等.<br />// Configure the processing rules that we need<br />// digester.addCallMethod("web-app/servlet-mapping",<br />// "addServletMapping", 2);<br />// digester.addCallParam("web-app/servlet-mapping/servlet-name", 0);<br />// digester.addCallParam("web-app/servlet-mapping/url-pattern", 1);<br />//initServlet()的上面一段将把Struts默认的后缀名从web.xml中解析得到<br />//也就是web.xml中的如下配置：<br />//<br />//action<br />//*.do<br />//默认以.do结尾的请求都将由Struts来处理，你可以自己修改<br />//<br />initServlet();</p>
		<p>// Initialize modules as needed<br />//在Attribute中保存类实例<br />getServletContext().setAttribute(Globals.ACTION_SERVLET_KEY, this);<br />//根据配置文件生成ModuleConfig,这是很重要的一步.下面会专门分析<br />//在tiles的配置中先解析注释为"Mark 0"的一个配置文件:/WEB-INF/struts-config.xml<br />//使用initModuleConfig方法解析XML文件.<br />//参数为prefix："",paths:"/WEB-INF/struts-config.xml"<br />ModuleConfig moduleConfig = initModuleConfig("", config);<br />//初始化Message<br />initModuleMessageResources(moduleConfig);<br />//初始化JDBC DataSource<br />initModuleDataSources(moduleConfig);<br />//初始化PlunIn<br />initModulePlugIns(moduleConfig);</p>
		<p>moduleConfig.freeze();<br />//在Struts1.1以后可以使用多个配置文件,在解析完默认的配置文件也就是上面提到的<br />//注释为"Mark 0"的一个配置文件:/WEB-INF/struts-config.xml后解析其他的配置文件<br />Enumeration names = getServletConfig().getInitParameterNames();<br />//依次解析注释为"Mark 1"、"Mark 2"、"Mark 3"对应配置文件<br />while (names.hasMoreElements()) {<br />//每一个配置文件的文件名<br />String name = (String) names.nextElement();<br />if (!name.startsWith("config/")) {<br />continue;<br />}<br />//<br />String prefix = name.substring(6);<br />moduleConfig = initModuleConfig<br />(prefix, getServletConfig().getInitParameter(name));</p>
		<p>initModuleMessageResources(moduleConfig);<br />initModuleDataSources(moduleConfig);<br />initModulePlugIns(moduleConfig);<br />moduleConfig.freeze();<br />}<br />destroyConfigDigester();</p>
		<p>}<br />/**<br />* 此方法使用Digester解析XML,关于使用Digester的介绍参看我的另外一篇文章<br />* <br />Initialize the application configuration information for the<br />* specified module.</p>
		<p>
				<br />*<br />* @param prefix Module prefix for this module<br />* @param paths Comma-separated list of context-relative resource path(s)<br />* for this modules's configuration resource(s)<br />*<br />* @exception ServletException if initialization cannot be performed<br />* @since Struts 1.1<br />*/<br />protected ModuleConfig initModuleConfig<br />(String prefix, String paths) throws ServletException {</p>
		<p>if (log.isDebugEnabled()) {<br />log.debug("Initializing module path '" + prefix +<br />"' configuration from '" + paths + "'");<br />}</p>
		<p>// Parse the configuration for this module<br />ModuleConfig config = null;<br />InputStream input = null;<br />String mapping = null;<br />try {<br />//工厂方法创建ModuleConfig标记为：prefix<br />ModuleConfigFactory factoryObject =<br />ModuleConfigFactory.createFactory();<br />config = factoryObject.createModuleConfig(prefix);</p>
		<p>// Support for module-wide ActionMapping type override<br />mapping = getServletConfig().getInitParameter("mapping");<br />if (mapping != null) {<br />config.setActionMappingClass(mapping);<br />}</p>
		<p>// Configure the Digester instance we will use<br />//得到解析XML的digester<br />Digester digester = initConfigDigester();</p>
		<p>// Process each specified resource path<br />while (paths.length() &gt; 0) {<br />//开始解析指定路径文件名的文件<br />digester.push(config);<br />String path = null;<br />//文件是否为多个并且使用","分割<br />int comma = paths.indexOf(',');<br />//存在多个配置文件<br />if (comma &gt;= 0) {<br />//先解析第一个<br />path = paths.substring(0, comma).trim();<br />//paths存放剩余的文件名下次再处理<br />paths = paths.substring(comma + 1);<br />} else {<br />//当前只存在一个<br />path = paths.trim();<br />//没有剩余,下次循环根据上面一句将会在唯一的循环退出点"point break"<br />//退出循环<br />paths = "";<br />}<br />//全部解析完成跳出循环<br />//point break<br />if (path.length() &lt; 1) {<br />break;<br />}<br />//根据文件名取文件<br />URL url = getServletContext().getResource(path);<br />InputSource is = new InputSource(url.toExternalForm());<br />input = getServletContext().getResourceAsStream(path);<br />is.setByteStream(input);<br />digester.parse(is);<br />//全局变量的形式把解析生成的ModuleConfig实例保存起来<br />//如"Mark 1"处标记的"config/examples",<br />//key为："org.apache.struts.action.MODULEexamples"<br />//Globals.MODULE_KEY值为:org.apache.struts.action.MODULE<br />getServletContext().setAttribute<br />(Globals.MODULE_KEY + prefix, config);<br />input.close();<br />}</p>
		<p>} catch (Throwable t) {<br />log.error(internal.getMessage("configParse", paths), t);<br />throw new UnavailableException<br />(internal.getMessage("configParse", paths));<br />} finally {<br />if (input != null) {<br />try {<br />input.close();<br />} catch (IOException e) {<br />;<br />}<br />}<br />}</p>
		<p>// Force creation and registration of DynaActionFormClass instances<br />// for all dynamic form beans we wil be using<br />//根据ModuleConfig实例得到配置的FormBean的配置<br />//注意：因为在Struts整个运行当中FormBean的实例要在Action的实例创建之前先创建<br />//因为Action执行perform(1.1以前)，execute（1.1）需要使用到FormBean<br />FormBeanConfig fbs[] = config.findFormBeanConfigs();<br />for (int i = 0; i &lt; fbs.length; i++) {<br />if (fbs[i].getDynamic()) {<br />DynaActionFormClass.createDynaActionFormClass(fbs[i]);<br />}<br />}</p>
		<p>// Special handling for the default module (for<br />// backwards compatibility only, will be removed later)<br />//下面是生成一些实例<br />if (prefix.length() &lt; 1) {<br />defaultControllerConfig(config);<br />defaultMessageResourcesConfig(config);<br />defaultFormBeansConfig(config);<br />defaultForwardsConfig(config);<br />defaultMappingsConfig(config);<br />}</p>
		<p>// Return the completed configuration object<br />//config.freeze(); // Now done after plugins init<br />return (config);</p>
		<p>}</p>
		<p>到此初始化工作基本结束，下面将处理具体的Http请求。在Servlet协议中所有的post方法将调用<br />以下方法来处理<br />public void doPost(HttpServletRequest request,<br />HttpServletResponse response)<br />throws IOException, ServletException {}<br />get方法也调用类似的方法来处理 </p>
		<p>在Struts中post,get方法都调用同一个方法<br />process(request, response);来处理具体的请求<br />如下：<br />/**<br />* 对每一个提交过来的Action进行处理<br />* Perform the standard request processing for this request, and create<br />* the corresponding response.<br />*<br />* @param request The servlet request we are processing<br />* @param response The servlet response we are creating<br />*<br />* @exception IOException if an input/output error occurs<br />* @exception ServletException if a servlet exception is thrown<br />*/<br />protected void process(HttpServletRequest request,<br />HttpServletResponse response)<br />throws IOException, ServletException {<br />//设置或删除Attribute<br />RequestUtils.selectModule(request, getServletContext());<br />//具体的处理交给RequestProcessor去处理HttpRequest,HttpResponse<br />//这是一个很典型的设计模式<br />//下面我们将详细来分析RequestProcessor，很容易理解Struts的运行方式<br />getRequestProcessor(getModuleConfig(request)).process(request, response);<br />}</p>
		<p>三:RequestProcessor分析<br />通过前面的分析我们知道Struts中对HttpRequest,HttpResponse的处理都交给RequestProcessor<br />的process（）方法来处理。下面我们来看看process方法<br />/**<br />* <br />Process an HttpServletRequest and create the<br />* corresponding HttpServletResponse.</p>
		<p>
				<br />*<br />* @param request The servlet request we are processing<br />* @param response The servlet response we are creating<br />*<br />* @exception IOException if an input/output error occurs<br />* @exception ServletException if a processing exception occurs<br />*/<br />public void process(HttpServletRequest request,<br />HttpServletResponse response)<br />throws IOException, ServletException {</p>
		<p>// Wrap multipart requests with a special wrapper<br />//如果是upload,返回一个MultipartRequestWrapper()<br />request = processMultipart(request);</p>
		<p>// Identify the path component we will use to select a mapping<br />//对request进行分析得到提交过来的Form Action<br />String path = processPath(request, response);<br />if (path == null) {<br />return;<br />}<br />if (log.isInfoEnabled()) {<br />log.info("Processing a '" + request.getMethod() +<br />"' for path '" + path + "'");<br />}</p>
		<p>// Select a Locale for the current user if requested<br />//本地化处理<br />processLocale(request, response);</p>
		<p>// Set the content type and no-caching headers if requested<br />processContent(request, response);<br />//设置Cache不保存<br />processNoCache(request, response);</p>
		<p>// General purpose preprocessing hook<br />if (!processPreprocess(request, response)) {<br />return;<br />}</p>
		<p>// Identify the mapping for this request<br />//得到path以后，根据配置文件(struts-config.xml)的相关配置来得到一个<br />//ActionMapping的实例<br />//ActionMapping继承ActionConfig<br />//仔细看一下ActionMapping的代码就能发现：<br />//下面的一段将解析影射一个ActionMapping的实例<br />//在ActionServlet在初始化的时候实际上已经把所有的ActionMapping的实例<br />//都已经创建好了。processMapping方法实际上是从Attribute中去得到已经<br />//保存好的ActionMapping的实例，可以理解为在Tomcat启动的时候已经<br />//把所有的ActionMapping保存在Attribute里面。所以在Tomcat启动的时候<br />//比较慢，如果Struts-config.xml有问题启动就会出错。<br />/***</p>
		<p>type="org.apache.struts.webapp.tiles.test.TestActionTileAction"&gt;</p>
		<p> </p>
		<p>**/<br />//****注意得到创建实例的顺序<br />//ActionMapping实例已经创建好了，现在从Atribute中取到<br />ActionMapping mapping = processMapping(request, response, path);<br />if (mapping == null) {<br />return;<br />}</p>
		<p>// Check for any role required to perform this action<br />if (!processRoles(request, response, mapping)) {<br />return;<br />}</p>
		<p>// Process any ActionForm bean related to this request<br />//根据mapping得到ActionForm的实例。<br />//同名ActionForm在系统中只会创建一次。<br />ActionForm form = processActionForm(request, response, mapping);<br />//压栈<br />processPopulate(request, response, form, mapping);<br />//处理校验,调用ActionForm的validate方法<br />//假如出错将会返回到前一页面<br />//也就是说在Action还没有创建之前就将做校验<br />if (!processValidate(request, response, form, mapping)) {<br />return;<br />}</p>
		<p>// Process a forward or include specified by this mapping<br />if (!processForward(request, response, mapping)) {<br />return;<br />}<br />if (!processInclude(request, response, mapping)) {<br />return;<br />}</p>
		<p>// Create or acquire the Action instance to process this request<br />//在得到ActionMapping、ActionForm的实例后接下来得到Action实例<br />//实例如果已经创建从Map里面去取如果没有创建一个并保存在Map里面<br />//对保存Action实例的Map 实现线程同步<br />Action action = processActionCreate(request, response, mapping);<br />if (action == null) {<br />return;<br />}</p>
		<p>// Call the Action instance itself<br />//在ActionMapping、ActionForm、Action实例创建好以后<br />//调用Action的execute()方法得到一个ActionForward<br />//因为所有的可执行Action都必须有override Action的execute()/perform()方法<br />ActionForward forward =<br />processActionPerform(request, response,<br />action, form, mapping);</p>
		<p>// Process the returned ActionForward instance<br />//Action已经正常执行，执行结束后将返回到另外一个页面<br />processActionForward(request, response, forward);</p>
		<p>}</p>
		<p>仔细阅读上面的代码，要特别注意ActionMapping、ActionForm、Action的实例是依次创建的。<br />创建完以后才去执行Action的execute()方法。为什么要依次创建ActionMapping、ActionForm<br />、Action??????</p>
		<p>
				<br />四:ModuleConfig分析<br />现在我们很有必要了解一下ModuleConfig这个类，因为太多地方用到了。<br />实际上ModuleConfig是一个接口有一个实现。org.apache.struts.config.impl.ModuleConfigImpl<br />具体实现我就没有不要去分析了。我们来看看这个接口。</p>
		<p>package org.apache.struts.config;</p>
		<p>/**<br />* <br />The collection of static configuration information that describes a<br />* Struts-based module. Multiple modules are identified by<br />* a prefix at the beginning of the context<br />* relative portion of the request URI. If no module prefix can be<br />* matched, the default configuration (with a prefix equal to a zero-length<br />* string) is selected, which is elegantly backwards compatible with the<br />* previous Struts behavior that only supported one module.</p>
		<p>
				<br />*<br />* @author Rob Leland<br />* @version $Revision: 1.2 $ $Date: 2002/12/22 05:31:14 $<br />* @since Struts 1.1<br />*/<br />public interface ModuleConfig {<br />/**<br />* Has this module been completely configured yet. Once this flag<br />* has been set, any attempt to modify the configuration will return an<br />* IllegalStateException.<br />*/<br />boolean getConfigured();</p>
		<p>/**<br />* The controller configuration object for this module.<br />*/<br />ControllerConfig getControllerConfig();<br />/**<br />* The controller configuration object for this module.<br />* @param cc The controller configuration object for this module.<br />*/</p>
		<p>void setControllerConfig(ControllerConfig cc);</p>
		<p>/**<br />* The prefix of the context-relative portion of the request URI, used to<br />* select this configuration versus others supported by the controller<br />* servlet. A configuration with a prefix of a zero-length String is the<br />* default configuration for this web module.<br />*/<br />String getPrefix();</p>
		<p>/**<br />* The prefix of the context-relative portion of the request URI, used to<br />* select this configuration versus others supported by the controller<br />* servlet. A configuration with a prefix of a zero-length String is the<br />* default configuration for this web module.<br />*/<br />public void setPrefix(String prefix);<br />/**<br />* The default class name to be used when creating action mapping<br />* instances.<br />*/<br />String getActionMappingClass();<br />/**<br />* The default class name to be used when creating action mapping<br />* instances.<br />* @param actionMappingClass default class name to be used when creating action mapping<br />* instances.<br />*/</p>
		<p>void setActionMappingClass(String actionMappingClass);</p>
		<p>/**<br />* Add a new ActionConfig instance to the set associated<br />* with this module.<br />*<br />* @param config The new configuration instance to be added<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void addActionConfig(ActionConfig config);</p>
		<p>/**<br />* Add a new DataSourceConfig instance to the set associated<br />* with this module.<br />*<br />* @param config The new configuration instance to be added<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void addDataSourceConfig(DataSourceConfig config);</p>
		<p>/**<br />* Add a new ExceptionConfig instance to the set associated<br />* with this module.<br />*<br />* @param config The new configuration instance to be added<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void addExceptionConfig(ExceptionConfig config);</p>
		<p>/**<br />* Add a new FormBeanConfig instance to the set associated<br />* with this module.<br />*<br />* @param config The new configuration instance to be added<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void addFormBeanConfig(FormBeanConfig config);</p>
		<p>/**<br />* Add a new ForwardConfig instance to the set of global<br />* forwards associated with this module.<br />*<br />* @param config The new configuration instance to be added<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void addForwardConfig(ForwardConfig config);</p>
		<p>/**<br />* Add a new MessageResourcesConfig instance to the set<br />* associated with this module.<br />*<br />* @param config The new configuration instance to be added<br />*<br />* @exception IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void addMessageResourcesConfig(MessageResourcesConfig config);</p>
		<p>/**<br />* Add a newly configured <a href="mailto:{@link">{@link</a> org.apache.struts.config.PlugInConfig} instance to the set of<br />* plug-in Actions for this module.<br />*<br />* @param plugInConfig The new configuration instance to be added<br />*/<br />void addPlugInConfig(PlugInConfig plugInConfig);</p>
		<p>/**<br />* Return the action configuration for the specified path, if any;<br />* otherwise return null.<br />*<br />* @param path Path of the action configuration to return<br />*/<br />ActionConfig findActionConfig(String path);</p>
		<p>/**<br />* Return the action configurations for this module. If there are<br />* none, a zero-length array is returned.<br />*/<br />ActionConfig[] findActionConfigs();</p>
		<p>/**<br />* Return the data source configuration for the specified key, if any;<br />* otherwise return null.<br />*<br />* @param key Key of the data source configuration to return<br />*/<br />DataSourceConfig findDataSourceConfig(String key);</p>
		<p>/**<br />* Return the data source configurations for this module. If there<br />* are none, a zero-length array is returned.<br />*/<br />DataSourceConfig[] findDataSourceConfigs();</p>
		<p>/**<br />* Return the exception configuration for the specified type, if any;<br />* otherwise return null.<br />*<br />* @param type Exception class name to find a configuration for<br />*/<br />ExceptionConfig findExceptionConfig(String type);</p>
		<p>/**<br />* Return the exception configurations for this module. If there<br />* are none, a zero-length array is returned.<br />*/<br />ExceptionConfig[] findExceptionConfigs();</p>
		<p>/**<br />* Return the form bean configuration for the specified key, if any;<br />* otherwise return null.<br />*<br />* @param name Name of the form bean configuration to return<br />*/<br />FormBeanConfig findFormBeanConfig(String name);</p>
		<p>/**<br />* Return the form bean configurations for this module. If there<br />* are none, a zero-length array is returned.<br />*/<br />FormBeanConfig[] findFormBeanConfigs();</p>
		<p>/**<br />* Return the forward configuration for the specified key, if any;<br />* otherwise return null.<br />*<br />* @param name Name of the forward configuration to return<br />*/<br />ForwardConfig findForwardConfig(String name);</p>
		<p>/**<br />* Return the form bean configurations for this module. If there<br />* are none, a zero-length array is returned.<br />*/<br />ForwardConfig[] findForwardConfigs();</p>
		<p>/**<br />* Return the message resources configuration for the specified key,<br />* if any; otherwise return null.<br />*<br />* @param key Key of the data source configuration to return<br />*/<br />MessageResourcesConfig findMessageResourcesConfig(String key);</p>
		<p>/**<br />* Return the message resources configurations for this module.<br />* If there are none, a zero-length array is returned.<br />*/<br />MessageResourcesConfig[] findMessageResourcesConfigs();</p>
		<p>/**<br />* Return the configured plug-in actions for this module. If there<br />* are none, a zero-length array is returned.<br />*/<br />PlugInConfig[] findPlugInConfigs();</p>
		<p>/**<br />* Freeze the configuration of this module. After this method<br />* returns, any attempt to modify the configuration will return<br />* an IllegalStateException.<br />*/<br />void freeze();</p>
		<p>/**<br />* Remove the specified action configuration instance.<br />*<br />* @param config ActionConfig instance to be removed<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void removeActionConfig(ActionConfig config);</p>
		<p>/**<br />* Remove the specified exception configuration instance.<br />*<br />* @param config ActionConfig instance to be removed<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void removeExceptionConfig(ExceptionConfig config);</p>
		<p>/**<br />* Remove the specified data source configuration instance.<br />*<br />* @param config DataSourceConfig instance to be removed<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void removeDataSourceConfig(DataSourceConfig config);</p>
		<p>/**<br />* Remove the specified form bean configuration instance.<br />*<br />* @param config FormBeanConfig instance to be removed<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void removeFormBeanConfig(FormBeanConfig config);</p>
		<p>/**<br />* Remove the specified forward configuration instance.<br />*<br />* @param config ForwardConfig instance to be removed<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void removeForwardConfig(ForwardConfig config);</p>
		<p>/**<br />* Remove the specified message resources configuration instance.<br />*<br />* @param config MessageResourcesConfig instance to be removed<br />*<br />* @exception java.lang.IllegalStateException if this module configuration<br />* has been frozen<br />*/<br />void removeMessageResourcesConfig(MessageResourcesConfig config);<br />}</p>
		<p>
				<br />上面的注释已经非常清晰了。我就不去浪费大家的时间了，再想仔细看就去看他的实现。<br />其实主要是对HashMap()的处理。</p>
		<p>五：ActionMapping分析<br />最后我们实现很有必要看一下ActionMapping,因为你如果想清楚的了解Struts-config.xml<br />这个配置文件的作用，你应该要知道ActionMapping<br />前面已经说过ActionMapping继承ActionConfig<br />以下就是ActionMapping加的四个方法。<br />/**<br />* <br />Find and return the ExceptionConfig instance defining<br />* how exceptions of the specified type should be handled. This is<br />* performed by checking local and then global configurations for the<br />* specified exception's class, and then looking up the superclass chain<br />* (again checking local and then global configurations). If no handler<br />* configuration can be found, return null.</p>
		<p>
				<br />*<br />* @param type Exception class for which to find a handler<br />* @since Struts 1.1<br />*/<br />public ExceptionConfig findException(Class type) {</p>
		<p>}</p>
		<p>
				<br />/**<br />* <br />Find and return the ForwardConfig instance defining<br />* how forwarding to the specified logical name should be handled. This is<br />* performed by checking local and then global configurations for the<br />* specified forwarding configuration. If no forwarding configuration<br />* can be found, return null.</p>
		<p>
				<br />*<br />* @param name Logical name of the forwarding instance to be returned<br />*/<br />public ActionForward findForward(String name) {</p>
		<p>}</p>
		<p>
				<br />/**<br />* <br />Return the logical names of all locally defined forwards for this<br />* mapping. If there are no such forwards, a zero-length array<br />* is returned.<br />*/<br />public String[] findForwards() {<br />}</p>
		<p>
				<br />/**<br />* </p>
		<p>Create (if necessary) and return an <a href="mailto:{@link">{@link</a> ActionForward} that<br />* corresponds to the input property of this Action.<br />*<br />* @since Struts 1.1b2<br />*/<br />public ActionForward getInputForward() {</p>
		<p>}</p>
		<p>还是看以下他的基类ActionConfig吧<br />public class ActionConfig implements Serializable {</p>
		<p>/**<br />* Has configuration of this component been completed?<br />*/<br />protected boolean configured = false;</p>
		<p>/**<br />* The set of exception handling configurations for this<br />* action, if any, keyed by the type property.<br />*/<br />protected HashMap exceptions = new HashMap();</p>
		<p>/**<br />* The set of local forward configurations for this action, if any,<br />* keyed by the name property.<br />*/<br />protected HashMap forwards = new HashMap();</p>
		<p>/**<br />* The module configuration with which we are associated.<br />*/<br />protected ModuleConfig moduleConfig = null;</p>
		<p>/**<br />* The request-scope or session-scope attribute name under which our<br />* form bean is accessed, if it is different from the form bean's<br />* specified name.<br />*/<br />protected String attribute = null;</p>
		<p>/**<br />* Context-relative path of the web application resource that will process<br />* this request via RequestDispatcher.forward(), instead of instantiating<br />* and calling the Action class specified by "type".<br />* Exactly one of forward, include, or<br />* type must be specified.<br />*/<br />protected String forward = null;</p>
		<p>/**<br />* Context-relative path of the web application resource that will process<br />* this request via RequestDispatcher.include(), instead of instantiating<br />* and calling the Action class specified by "type".<br />* Exactly one of forward, include, or<br />* type must be specified.<br />*/<br />protected String include = null;</p>
		<p>/**<br />* Context-relative path of the input form to which control should be<br />* returned if a validation error is encountered. Required if "name"<br />* is specified and the input bean returns validation errors.<br />*/<br />protected String input = null;</p>
		<p>/**<br />* Fully qualified Java class name of the<br />* MultipartRequestHandler implementation class used to<br />* process multi-part request data for this Action.<br />*/<br />protected String multipartClass = null;</p>
		<p>/**<br />* Name of the form bean, if any, associated with this Action.<br />*/<br />protected String name = null;</p>
		<p>/**<br />* General purpose configuration parameter that can be used to pass<br />* extra iunformation to the Action instance selected by this Action.<br />* Struts does not itself use this value in any way.<br />*/<br />protected String parameter = null;</p>
		<p>/**<br />* Context-relative path of the submitted request, starting with a<br />* slash ("/") character, and omitting any filename extension if<br />* extension mapping is being used.<br />*/<br />protected String path = null;</p>
		<p>/**<br />* Prefix used to match request parameter names to form ben property<br />* names, if any.<br />*/<br />protected String prefix = null;</p>
		<p>/**<br />* Comma-delimited list of security role names allowed to request<br />* this Action.<br />*/<br />protected String roles = null;</p>
		<p>/**<br />* Identifier of the scope ("request" or "session") within which<br />* our form bean is accessed, if any.<br />*/<br />protected String scope = "session";</p>
		<p>/**<br />* Suffix used to match request parameter names to form bean property<br />* names, if any.<br />*/<br />protected String suffix = null;</p>
		<p>/**<br />* Fully qualified Java class name of the Action class<br />* to be used to process requests for this mapping if the<br />* forward and include properties are not set.<br />* Exactly one of forward, include, or<br />* type must be specified.<br />*/<br />protected String type = null;</p>
		<p>/**<br />* Should the validate() method of the form bean associated<br />* with this action be called?<br />*/<br />protected boolean validate = true;<br />}</p>
		<p>其实ActionConfig是一个很典型的ValueObject.所以其他的get/set方法我就不写出来了。<br />看这个代码一定要和struts-config.xml一起来看，根据struts-config.xml去找找<br />每一段配置文件最终要生成一个ActionConfig,他们之间的对应关系。<br />如果你想扩展Struts,ActionMapping估计你一定要修改。还有ActionServlet你也要修改。</p>
		<p>六：结束语<br />分析了一些代码下面做一些概述。先来整体的了解一下Struts的工作流程.<br />在实现一个基于Struts的运用之前我们首先是做环境设置，Struts正常工作需要至少两个<br />配置文件web.xml,struts-config.xml.<br />web.xml告诉App Server所有以.do结尾的请求最终提交给ActionServlet去处理。<br />2就规定ActionServlet是在App Server启动的时候<br />创建的并且一直存在。<br />ActionServlet在创建的时候会做如下的工作：<br />保存一些后面需要使用的实例在Attribute(内存)里面。<br />根据web.xml的配置解析struts-config.xml文件。<br />根据struts-config.xml的配置生成ActionMapping实例并且保存。</p>
		<p>ActionServlet在生命周期就一直等待Http 请求<br />每一个.do结尾的Http 请求都由ActionServlet先截获然后根据请求路径得到具体调用那<br />一个Action去处理，在这之前生成、处理ActionForm。具体知道那一个Action去处理请求<br />后调用Action的execute()/perform()处理完成，返回。</p>
		<p>
				<br /> <br /></p>
<img src ="http://www.blogjava.net/ericli1982/aggbug/69455.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-13 20:23 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/13/69455.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Toad中出现问题</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/13/69454.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Wed, 13 Sep 2006 12:21:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/13/69454.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/69454.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/13/69454.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/69454.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/69454.html</trackback:ping><description><![CDATA[ toad连接出现问题：<br />可能是一些环境变量被修改了，比如昨天我碰到的问题 <br />d:\oracle\ora92\BIN 被修改了，在path 里面将其配置好，就可以了<br />正常的配置信息如下： <br /> (Oracle Root)<br />  ORACLE_HOME = d:\oracle\ora92<br />  ORACLE_SID = <br />  NLS_LANG = NA<br />  SQLPATH = <br />  d:\oracle\ora92\BIN is in system PATH<br />  d:\oracle\ora92\BIN does exist<br />  Client dll found oci.dll<br />  oci.dll version: 9.2.0.1.0   <br />  (Oracle Root) is valid<br />HOME0<br />  ORACLE_HOME_NAME = OraHome92<br />  ORACLE_HOME = d:\oracle\ora92<br />  ORACLE_SID = NHOALG<br />  NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK<br />  SQLPATH = d:\oracle\ora92\dbs<br />  d:\oracle\ora92\BIN is in system PATH<br />  d:\oracle\ora92\BIN does exist<br />  Client dll found oci.dll<br />  oci.dll version: 9.2.0.1.0<br />  HOME0 is valid<br />$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$<br />同事遇到问题，toad安装好一次后，就打不开了<br />是版本的问题，换了一个版本就好了<br />7.6--8.0 <br /> <img src ="http://www.blogjava.net/ericli1982/aggbug/69454.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-13 20:21 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/13/69454.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse ShortCut</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/13/69453.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Wed, 13 Sep 2006 12:20:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/13/69453.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/69453.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/13/69453.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/69453.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/69453.html</trackback:ping><description><![CDATA[
		<p>★ Eclipse 3.0 RC2 熱鍵表 (中英對照版，Default) ★ </p>
		<p>Author：sungo <br />Date：2004/06/16 (三) </p>
		<p>
				<br />◎閱讀說明：冒號 ( : )後的藍色標註熱鍵為Eclipse預設的標準熱鍵，空 <br />白即表示Eclipse並未對該項目設熱鍵；紅色標註選項表示常用或重要熱 <br />鍵；淡粉紅色標註選項，表示可以啟動該熱鍵的範圍。 </p>
		<p>◎熱鍵修改處： <br />Window-&gt;Preference-&gt;Workbench-&gt;Keys </p>
		<p>◎FAQ，如果沒設熱鍵的功能要如何啟動？ <br />方法一.自己增設熱鍵。 <br />方法二.熱鍵設定裡的選項，其實功能表大部分都有，可以由功能表中直接點選。 </p>
		<p>◎給所有在看這篇文章的朋友： <br />T55555為了JavaWorld週年慶把DG2拿出來了，為了效法他的精神，所以我決定把 <br />我的第一次也貢獻出來，加入JavaWorld這半年來我第一次打這麼長的文章...XD <br />。本來打算3.0 Release出來後再整理熱鍵表，但3.0 RC系列架構已經趨於平穩， <br />Release出來也不會有多大的變動，所以就先整理了。熱鍵表所列的功能，只要您 <br />全部實際操作過一遍，將會為您在操作Eclipse上，帶來莫大的助益。 </p>
		<p>------------------------------------------------------------------------------------------------------------- </p>
		<p>Compare - 比較 <br />Copy All from Left to Right (由左向右複製全部) <br />Copy All from Right to Left (由右向左複製全部) <br />Copy from Left to Right (由左向右複製) <br />Copy from Right to Left (由右向左複製) <br />Select Next Change (選取下一個變更) <br />Select Previous Change (選取上一個變更) </p>
		<p>CVS - Concurrent Versions System (版本控制系統) <br />Checkout from CVS (由CVS檢查) </p>
		<p>Edit - 編輯 <br />Add Bookmark (新增書籤) <br />Add Task (新增作業) <br />Collapse (程式碼折疊) ： Ctrl+鍵盤右方數字區的'-' &lt;Editing Text&gt; <br />Content Assist (內容輔助 - Code Templetes啟動)： Alt+/ 或 Ctrl+Space &lt;In Dialogs and Windows&gt; <br />Context Information (內容資訊) ： Alt+？ 或 ALT+Shift+？或 Ctrl+Shift+Space &lt;In Windows&gt; <br />Copy (複製選取文字到OS剪貼簿) ： Ctrl+C &lt;In Dialogs and Windows&gt; <br />Custom Encoding (自訂編碼) <br />Cut (剪下選取文字並加至OS剪貼簿) ： Ctrl+X &lt;In Dialogs and Windows&gt; <br />Default Encoding (使用預設編碼) <br />Delete (刪除選取的文字) ： Delete &lt;In Windows&gt; <br />Expand (程式碼展開) ： Ctrl+鍵盤右方數字區的'+' &lt;Editing Text&gt; <br />Expand All (程式碼全部展開) ： Ctrl+鍵盤右方數字區的'*' &lt;Editing Text&gt; <br />Find and Replace (尋找並取代文字) ： Ctrl+F &lt;In Windows&gt; <br />Find Next (尋找下一個項目) ： Ctrl+K &lt;Editing Text&gt; <br />Find Previous (尋找上一個項目) ： Ctrl+Shift+K &lt;Editing Text&gt; <br />Incremental Find (漸進式尋找) ： Ctrl+J &lt;Editing Text&gt; <br />Incremental Find Reverse (逆向漸進式尋找) ： Ctrl+Shift+J &lt;Editing Text&gt; <br />ISO-8859-1 Encoding (將編碼變更為 ISO-8859-1) <br />Paste (從OS剪貼簿貼上文字) ： Ctrl+V &lt;In Dialogs and Windows&gt; <br />Quick Diff Toggle (QuickDiff 開啟/關閉) ： Ctrl+Shift+Q &lt;Editing Text&gt; <br />Quick Fix (快速套件修正) ： Ctrl+1 &lt;Editing Java Source&gt; <br />Redo (重做上一次作業) ： Ctrl+Y &lt;In Windows&gt; <br />Restore Last Selection (恢復最後選取) ： Alt+Shift+方向鍵'↓' &lt;Editing Java Source&gt; <br />Revert to Saved (回復至已儲存) <br />Select All (選擇全部文字) ： Ctrl+A &lt;In Dialogs and Windows&gt; <br />Select Enclosing Element ： (選取含括的元素) Alt+Shift+方向鍵'↑' &lt;Editing Java Source&gt; <br />Select Next Element (選取下一個元素) ： Alt+Shift+方向鍵'→' &lt;Editing Java Source&gt; <br />Select Previous Element (選取上一個元素) ： Alt+Shift+方向鍵'←' &lt;Editing Java Source&gt; <br />Shift Left (將該行文字往左移動一個縮排) <br />Shift Right (將該行文字往右移動一個縮排) <br />Show Tooltip Description (在游標位置顯示元素的工具提示說明) ： F2 &lt;Editing Java Source&gt; <br />System Encoding (將編碼變更為系統編碼) <br />Toggle Folding (程式碼折疊、展開功能 開啟/關閉) ： Ctrl+鍵盤右方數字區的'/' &lt;Editing Text&gt; <br />Toggle Insert Model (Smart Insert模式 開啟/關閉) ： Ctrl+Shift+Insert &lt;Editing Text&gt; <br />Undo (復原前次作業) ： Ctrl+Z &lt;In Windows&gt; <br />US ASCII Encoding (將編碼變更為 ASCII) <br />UTF-16BE Encoding (將編碼變更為 UTF-16BE) <br />UTF-16 Encoding (將編碼變更為 UTF-16) <br />UTF-16LE Encoding (將編碼變更為 UTF-16LE) <br />UTF-8 Encoding (將編碼變更為 UTF-8) </p>
		<p>File - 檔案 <br />Close (關閉檔案) ： Ctrl+W 或 Ctrl+F4 &lt;In Windows&gt; <br />Close All (關閉全部檔案) ： Ctrl+Shift+W 或 Ctrl+Shift+F4 &lt;In Windows&gt; <br />Exit (關閉螢幕最上層視窗) ： Alt+F4 &lt;In Dialogs and Windows&gt;   0<br />(註：3.0RC2並沒預設這組熱鍵，但仍然可以使用。) </p>
		<p>Export (開啟匯出功能表) <br />Import (開啟匯入功能表) <br />Move (移動檔案) <br />New (開啟檔案建立精靈Wizard) ： Ctrl+N &lt;In Windows&gt; <br />New menu (顯示File-&gt;New選單) ： ALT+Shift+N &lt;In Windows&gt; <br />Open External File (開啟外部檔案) <br />Open Workspace (開啟Workspace設定視窗) <br />Print (列印檔案) ： Ctrl+P &lt;In Windows&gt; <br />Properties (org.eclipse.ui.file.properties) (顯示檔案內容) ： Alt+Enter &lt;In Windows&gt; <br />Refresh (重新整理) ： F5 &lt;In Windows&gt; <br />Rename (重新命名) ： F2 &lt;In Windows&gt; <br />Revert (回復至已儲存) <br />Save (儲存檔案) ： Ctrl+S &lt;In Windows&gt; <br />Save All (儲存全部檔案) ： Ctrl+Shift+S &lt;In Windows&gt; <br />Save As (另存新檔) </p>
		<p>Help - 說明 <br />About (開啟關於對話框) <br />Help Contents (開啟Eclipse說明文件) <br />Tips and Tricks (開啟要訣和技巧說明頁面) <br />Weclome (開啟歡迎使用頁面) </p>
		<p>Navigate - 導覽 <br />Back (向後導覽) <br />Backward History (在編輯器導覽歷程中向後移動) ： Alt+方向鍵'←' &lt;In Windows&gt; <br />Forward (向前導覽) <br />Forward History (在編輯器導覽歷程中向前移動) ： Alt+方向鍵'→' &lt;In Windows&gt; <br />Go Into (進入選取的目錄內) <br />Go to Line (移至某一行文字) ： Ctrl+L &lt;Editing Text&gt; <br />Go to Matching Bracket (將游標移至對稱的方括弧) ： Ctrl+Shift+P &lt;Editing Java Source&gt; <br />Go to Next Member (移至下一個Member) ： Ctrl+Shift+方向鍵'↓' &lt;Editing Java Source&gt; <br />Go to Package (移至套件，用於Package Explorer) <br />Go to Previous Member (移至上一個Member) ： Ctrl+Shift+方向鍵'↑' &lt;Editing Java Source&gt; <br />Go to Resource (移至資源) <br />Go to Type (移至類別，用於Package Explorer) <br />Last Edit Loaction (移至前次編輯位置) ： Ctrl+Q &lt;In Windows&gt; <br />Next (移至下一個標示元素) ： Ctrl+. &lt;In Windows&gt; <br />(註：元素類型可由Toolbar的Next Annotation小倒三角圖示設定。) </p>
		<p>Open Call Hierarchy (開啟Call Hierarchy視窗) ： Ctrl+Alt+H &lt;In Windows&gt; <br />Open Declaration (瀏覽所選取的Java元素) ： F3 &lt;In Windows&gt; (註：效果等於Ctrl+滑鼠左鍵點選。) <br />Open External Javadoc (開啟外部Javadoc) ： Shift+F2 &lt;In Windows&gt; <br />Open Resource (開啟資源選取對話方塊) ： Ctrl+Shift+R &lt;In Windows&gt; <br />Open Structure (顯示所選元素的結構) ： Ctrl+F3 &lt;Editing Java Source&gt; <br />Open Super Implementation (開啟super類型中的實作) <br />Open Type (開啟類別) ： Ctrl+Shift+T &lt;In Windows&gt; <br />Open Type Hierarchy (開啟類別階層顯示視窗) ： F4 &lt;In Windows&gt; <br />Open Type in Hierarchy (在類別階層的視圖中開啟類別) ： Ctrl+Shift+H &lt;In Windows&gt; <br />Previous (移至上一個標示元素) ： Ctrl+, &lt;In Windows&gt; <br />(註：元素類型可由Toolbar的Previous Annotation小倒三角圖示設定。) </p>
		<p>Quick Hierarchy (以浮動方式將類別階層視窗顯示在編輯器上) ： Ctrl+T &lt;Editing Java Source&gt; <br />Quick Outline (以浮動方式將概要視窗顯示在編輯器上) ： Ctrl+O &lt;Editing Java Source&gt; <br />Show In menu (顯示當前Show In功能表可用的選項) ： Alt+Shift+W &lt;In Windows&gt; <br />Show in Package Explorer (在套件瀏覽器中顯示所選元素) <br />Up (導覽上一層) </p>
		<p>Project - 專案 <br />Build All (建置所有專案) ： Ctrl+B &lt;In Windows&gt; <br />Build Clean (清除專案) <br />Build Project (建置專案) <br />Close Project (關閉專案) <br />Generate Javadoc (產生Javadoc) <br />Open Project (開啟專案) <br />Properties (org.eclipse.ui.project.properties) (開啟專案屬性設定視窗) <br />Rebuild All (重新建置所有專案) <br />Rebuild Project (重新建置專案) <br />Repeat Working Set Build (重複建置所設定的專案) (註：Build Automatically 關閉時才可使用。) </p>
		<p>Refactor - Java (重構 - Java) <br />Change Method Signature (變更方法簽章) ： Alt+Shift+C &lt;In Windows&gt; <br />Convert Anonymous Class to Nested (將匿名類別轉換成巢狀類別) <br />Convert Local Variable to Field (將區域變數轉換成欄位) ： Alt+Shift+F &lt;Editing Java Source&gt; <br />Encapsulate Field (封裝欄位：為欄位建立getting和setting方法，並只用這些方法來存取欄位) <br />Extract Constant (擷取成常數：將數字擷取至新的Static欄位，並使用新的Static欄位) </p>
		<p>註：&lt;-START-&gt; </p>
		<p>如下段程式碼經由Extract Constant重構數字10後... <br />12345<br /> public class Test {<br />    public static void main(String[] args) {<br />        int x = 10;<br />    }<br />}</p>
		<p> <br />會變成下列程式碼：(常數欄位名稱，在重構時可以自由設定。)123456<br /> public class Test {<br />    public static final int TEN = 10;<br />    public static void main(String[] args) {<br />        int x = TEN;<br />    }<br />}</p>
		<p> <br />註：&lt;-END-&gt; </p>
		<p>Extract Interface (擷取成介面：將原類別內的方法擷取至新介面中，原類別將實作該介面) <br />(註：新介面會存成一個新的*.java檔。若是在interface中執行此功能，舊介面則會繼承新介面。) <br />Extract Local Variable (擷取成區域變數：將數字擷取為新的區域變數) ： Alt+Shift+L &lt;In Windows&gt; <br />Extract Method (擷取成方法：將選取的表示式擷取成一個新方法) ： Alt+Shift+M &lt;In Windows&gt; <br />Generalize Type (將reference的類別型態更改可以取代的Superclass) <br />Inline (列入常數、區域變數或方法) ： Alt+Shift+I &lt;In Windows&gt; <br />Introduce Factory (採用代理：利用方法來取得建構子) </p>
		<p>註：&lt;-START-&gt; </p>
		<p>如下段程式碼經由Introduce Factory重構Test建構子後... <br />123456789<br /> public class Test {<br />    private int number;<br />    Test(int x) {<br />        number = x;<br />    }<br />    public static void main(String[] args) {<br />        System.out.println(new Test(5).number);<br />    }<br />}</p>
		<p> <br />會變成下列程式碼：123456789101112<br /> public class Test {<br />    private int number;<br />    public Test(int x) {<br />        number = x;<br />    }<br />    public static void main(String[] args) {<br />        System.out.println(createTest(5).number);<br />    }<br />    public static Test createTest(int x) {<br />        return new Test(x);<br />    }<br />}</p>
		<p> <br />註：&lt;-END-&gt; </p>
		<p>Introduce Parameter (採用參數：將區域變數改成參數方式傳遞) </p>
		<p>註：&lt;-START-&gt; </p>
		<p>如下段程式碼經由Introduce Parameter重構數字5後... <br />12345<br /> public class Test {<br />    public static void main(String[] args) {<br />        int x = 5;<br />    }<br />}</p>
		<p> <br />會變成下列程式碼：12345<br /> public class Test {<br />    public static void main(String[] args, int five) {<br />        int x = five;<br />    }<br />}</p>
		<p> <br />註：&lt;-END-&gt; </p>
		<p>Move Member Type to New File (將類別成員移至一個新檔) <br />Move - Refactoring (移動 - 重構：將所選取的元素移至新位置) ： Alt+Shift+V &lt;In Windows&gt; <br />Pull Up (將類別成員&lt;欄位與方法&gt;上推到類別的父類別中) <br />Push Down (將類別成員(欄位與方法)下推到類別的子類別中) <br />Redo - Refactoring (重做 - 重構：重做前次的重構) ： Alt+Shift+Y &lt;In Windows&gt; <br />Refactor Quick Menu (在編輯區顯示重構的快速功能表) ： Alt+Shift+T &lt;In Windows&gt; <br />Rename - Refactoring (更名 - 重構：將所選取的元素重新命名，類別名稱、區域變數名稱等...) ： <br />Alt+Shift+R &lt;In Windows&gt; <br />Undo - Refactoring (復原 - 重構：復原前次的重構) ： Alt+Shift+Z &lt;In Windows&gt; <br />Use Supertype Where Possible (啟動「適當時使用父類別」重構對話框。) </p>
		<p>◎補充命名規則：(重構時不照此規則命名時，Eclipse將會警示， <br />雖然可以不管警示，但這是個好風格。) </p>
		<p>1.介面(interface)名稱：開頭大寫。 <br />2.區域變數(Local Variable)名稱：開頭小寫 。 <br />3.常數欄位(public static final int...)名稱：全部大寫。 </p>
		<p>Run/Debug - 執行/除錯 <br />Add Class Load Breakpoint (新增一個類別載入中斷點)) <br />Add Java Exception Breakpoint (新增一個Java異常狀況中斷點) <br />Debug... (開啟除錯啟動配置對話框) <br />Debug Last Launched (開啟最近一次啟動作業的除錯模式) ： F11 &lt;In Windows&gt; <br />Display (org.eclipse.jdt.debug.ui.commands.Display) (顯示) ： Ctrl+Shift+D &lt;In Windows&gt; <br />(註：當執行緒暫停時，此指令會使用「顯示」檢視畫面，顯示在該執行緒之堆疊框或變數的環境定義下 <br />，評估所選表示式的結果。) </p>
		<p>Execute (執行：開啟執行啟動配置對話框) ： Ctrl+U &lt;In Windows&gt; <br />Inspect (觀察)： Ctrl+Shift+I &lt;In Windows&gt; <br />(註：當執行緒暫停時，此指令會使用「表示式」檢視畫面，顯示在該執行緒之堆疊框或變數的環境定義 <br />下，視察所選表示式或變數的結果。) </p>
		<p>Profile Last Launched (最近一次作業的概況) <br />Resume (繼續執行緒的執行) ： F8 &lt;Debugging&gt; <br />Run Last Launched (在執行模式下迅速執行最近一次的啟動作業)： Ctrl+F11 &lt;In Windows&gt; <br />Run Last Launched External Tool (執行前一次啟動的外部工具) <br />Run to Line (執行至指定行，可在沒有設定中斷點之處暫停執行) ： Ctrl+R &lt;Debugging&gt; <br />Skip All Breakpoints (在不清除中斷點的情況下，執行時跳過所有的中斷點) <br />Step Into (進入副程序) ： F5 &lt;Debugging&gt; <br />Step Into Selection (進入目前所選的陳述式進行副程序除錯) ： Ctrl+F5 &lt;Debugging&gt; <br />Step Over (跳過副程序) ： F6 &lt;Debugging&gt; <br />Step Return (跳出副程序)： F7 &lt;Debugging&gt; <br />Suspend (暫停執行緒) <br />Terminate (終止執行緒) <br />Toggle Breakpoint (新增/移除，中斷點) ： Ctrl+Shift+B &lt;In Windows&gt; <br />Toggle Method Breakpoint (新增/移除，方法中斷點) <br />Toggle Step Filters (以過濾條件逐步除錯) ： Shift+F5 &lt;In Windows&gt; <br />Toggle Watchpoint (新增/移除，欄位的監視點) </p>
		<p>Search - 搜索 <br />Declaration in Hierarchy (在它的階層中搜尋所選元素的宣告) <br />Declaration in Project (在專案中搜尋所選元素的宣告) <br />Declaration in Working Set (在工作集中搜尋所選元素的宣告) <br />Declaration in Workspace (在工作區中搜尋所選元素的宣告) ： Ctrl+G &lt;In Windows&gt; <br />Exception Occurrences (搜索例外事件) <br />File Search (開啟搜尋對話框的檔案搜尋頁面) <br />Implementors in Project (在專案中搜尋所選介面的實作者) <br />Implementors in Working Set (在工作集中搜尋所選介面的實作者) <br />Implementors in Workspace (在工作區中搜尋所選介面的實作者) <br />Occurrences in File (在它的宣告檔案中搜尋所選元素的所有出現處) ： Ctrl+Shift+U &lt;In Windows&gt; <br />Open Search Dialog (開啟搜尋對話框) ： Ctrl+H &lt;In Windows&gt; <br />Read Access in Hierarchy (在它的階層中搜尋所選元素的讀取參考) <br />Read Access in Project (在專案中搜尋所選元素的讀取參考) <br />Read Access in Working Set (在工作集中搜尋所選元素的讀取參考) <br />Read Access in Workspace (在工作區中搜尋所選元素的讀取參考) <br />References in Hierarchy (在它的階層中搜尋所選元素的參考) <br />References in Project (在專案中搜尋所選元素的參考) <br />References in Working Set (在工作集中搜尋所選元素的參考) <br />References in Workspace (在工作區中搜尋所選元素的參考) ： Ctrl+Shift+G &lt;In Windows&gt; <br />Referring Tests (查詢測試) <br />Write Access in Hierarchy (在它的階層中搜尋所選元素的寫入參考) <br />Write Access in Project (在專案中搜尋所選元素的寫入參考) <br />Write Access in Working Set (在工作集中搜尋所選元素的寫入參考) <br />Write Access in Workspace (在工作區中搜尋所選元素的寫入參考) </p>
		<p>Source - 程式碼 <br />Add Block Comment (將選取的字行以多行註解/**/包起來) ： Ctrl+Shift+/ &lt;Editing Java Source&gt; <br />Add Constructors from Superclass (從父類別增加一個建構子) <br />Add Import (為目前所選的類別參考建立一項匯入宣告) ： Ctrl+Shift+M &lt;Editing Java Source&gt; <br />Add Javadoc Comment (新增Javadoc註解) ： Alt+Shift+J &lt;In Windows&gt; <br />Comment (註解) <br />Externalize Strings (開啟「外部化字串」精靈) <br />Find Strings to Externalize (尋找要外部化的字串) <br />Format (程式碼自動排版) ： Ctrl+Shift+F &lt;Editing Java Source&gt; <br />Format Element (格式化元素) <br />Generate Constructor using Fields (使用欄位來產生建構子) </p>
		<p>註：&lt;-START-&gt; </p>
		<p>如下段程式碼，選取欄位名稱money並經由Generate Constructor using Fields指令後... <br />12345<br /> public class Test {<br />    int money;<br />    public static void main(String[] args) {<br />    }<br />}</p>
		<p> <br />會變成下列程式碼：12345678<br /> public class Test {<br />    int money;<br />    public Test(int money) {<br />        this.money = money;<br />    }<br />    public static void main(String[] args) {<br />    }<br />}</p>
		<p> <br />註：&lt;-END-&gt; </p>
		<p>Generate Delegate Methods (開啟「產生委派方法」對話框，可新增類型欄位的委派方法) <br />Generate Getters and Setters (開啟「產生Getter與Setter」對話框，可以為欄位自動 <br />建立Getter和Setter方法) <br />Indent Line (單行縮排，其會遵照Formatter設定的格式) ： Ctrl+I &lt;Editing Java Source&gt; <br />Mark Occurrences (標註事件)： Alt+Shift+O &lt;Editing Java Source&gt; <br />Organize Imports (組織匯入) ： Ctrl+Shift+O &lt;In Windows&gt; <br />(註：這是個很方便的功能，簡易說明一下使用時機：假設我們在程式中打，JFrame src;而並未 <br />import任何swing類別，此時Eclipse便會出現錯誤警示，用紅底線將JFrame標起來，此時只要按 <br />下Ctrl+Shift+O，Eclipse便會自動將：import javax.swing.JFrame;加到程式碼中了。) </p>
		<p>Override/Implement Methods (開啟「覆寫/實作方法」對話框，可覆寫或實作現行類別中的方法) <br />Remove Block Comment (移除多行註解/**/) ： Ctrl+Shift+\ &lt;Editing Java Source&gt; <br />Remove Occurrence Annotations (移除事件書籤)： Alt+Shift+U &lt;Editing Java Source&gt; <br />Sort Members (排序成員) <br />Source Quick Menu (在編輯區顯示Source的快速功能表) ： Alt+Shift+S &lt;In Windows&gt; <br />Surround with try/catch Block (以try/catch區塊包覆所選文字) <br />Toggle Comment (加上單行註解/取消單行註解) ： Ctrl+/ 或 Ctrl+7 或 Ctrl+Shift+C <br />&lt;Editing Java Source&gt; <br />Uncomment (取消註解) </p>
		<p>◎補充，Source 隱藏熱鍵： <br />1.Shift Right (向右移位，增加目前所選字行的內縮層次) ： Tab &lt;Editing Java Source&gt; <br />2.Shift Left (向左移位，減少目前所選字行的內縮層次) ： Shift+Tab &lt;Editing Java Source&gt; </p>
		<p>Team - 團隊 <br />Synchronize (同步化) </p>
		<p>Text Editing - 文字編輯 <br />Claer Mark (清除標記) <br />Copy Lines (將選取的文字，複製成新行) ： Ctrl+Alt+方向鍵'↓' &lt;Editing Text&gt; <br />Cut Line (剪下單行文字) <br />Cut to Beginning of Line (剪下文字，範圍為選取處至單行開頭) <br />Cut to End of Line (剪下文字，範圍為選取處至單行尾端) <br />Delete Line (刪除單行文字) ： Ctrl+D &lt;Editing Text&gt; <br />Delete Next (刪除下一行) <br />Delete Next Word (刪除下一個字組) ： Ctrl+Delete &lt;Editing Text&gt; <br />Delete Previous (刪除前一行) <br />Delete Previous Word (刪除前一個字組) ： Ctrl+Backspace &lt;Editing Text&gt; <br />Delete to Beginning of Line (刪除文字，範圍為選取處至單行開頭) <br />Delete to End of Line (刪除文字，範圍為選取處至單行尾端) <br />Duplicate Lines (將選取的文字，複製成新行) ： Ctrl+Alt+方向鍵'↑' &lt;Editing Text&gt; <br />Insert Line Above Current Line (在游標處的該行上方插入新行) ： Ctrl+Shift+Enter &lt;Editing Text&gt; <br />Insert Line Below Current Line (在游標處的該行下方插入新行) ： Shift+Enter &lt;Editing Text&gt; <br />Line Down (游標往下移一行) <br />Line End (游標移至該行尾端) <br />Line Start (游標移至該行開頭) <br />Line Up (游標往上移一行) <br />Move Lines Down (將該行文字往下移動) ： Alt+方向鍵'↓' &lt;Editing Text&gt; <br />Move Lines Up (將該行文字往上移動) ： Alt+方向鍵'↑' &lt;Editing Text&gt; <br />Next Column (游標移至下一列) <br />Next Word (游標移至下一個字組) ： Ctrl+方向鍵'→' &lt;Editing Text&gt; <br />Page Down (移至下一頁) <br />Page Up (移至上一頁) <br />Previous Column (游標移至上一列) <br />Previous Word (游標移至上一個字組) ： Ctrl+方向鍵'←' &lt;Editing Text&gt; <br />Scroll Line Down (向下捲動) ： Ctrl+方向鍵'↓' &lt;Editing Text&gt; <br />Scroll Line Up (向上捲動) ： Ctrl+方向鍵'↑' &lt;Editing Text&gt; <br />Select Line Down (選取下一行) <br />Select Line End (選取至文字尾端) <br />Select Line Start (選取至文字開頭) <br />Select Line Up (選取上一行) <br />Select Next Column (選取下一列) <br />Select Next Word (選取下一個字組)： Ctrl+Shift+方向鍵'→' &lt;Editing Text&gt; <br />Select Page Down (選取下一頁) <br />Select Page Up (選取上一頁) <br />Select Previous Column (選取上一列) <br />Select Previous Word (選取前一個字組) ： Ctrl+Shift+方向鍵'←' &lt;Editing Text&gt; <br />Select Text End (選取至文字編輯器尾端) <br />Select Text Start (選取至文字編輯器開頭) <br />Select Window End (選取至視窗尾端) <br />Select Window Start (選取至視窗開頭) <br />Set Mark (設定標記) <br />Swap Mark (交換標記) <br />Text End (游標移至文字編輯器最底端) <br />Text Start (游標移至文字編輯器最頂端) <br />Toggle Overwrite (覆寫/插入 模式選擇) ： Insert &lt;Editing Text&gt; <br />To Lower Case (將選取的英文字轉為小寫) ： Ctrl+Shift+Y &lt;Editing Text&gt; <br />To Upper Case (將選取的英文字轉為大寫) ： Ctrl+Shift+X &lt;Editing Text&gt; <br />Window End (將游標移至視窗尾端) <br />Window Start (將游標移至視窗開頭) </p>
		<p>Views - 檢視 <br />Ant (開啟Ant檢視視窗) <br />Bookmarks (開啟書籤檢視視窗) <br />Breakpoints (開啟中斷點檢視視窗) <br />Classic Search (開啟傳統的搜索檢視視窗) <br />Console (開啟主控台檢視視窗) <br />CVS Annotate (開啟CVS Annotate檢視視窗) <br />CVS Editors (開啟CVS Editor檢視視窗) <br />CVS Repositories (開啟CVS Repositories檢視視窗) <br />CVS Resource History (開啟CVS Resource History檢視視窗) <br />Debug (開啟除錯檢視視窗) <br />Display (org.eclipse.jdt.debug.ui.DisplayView) (開啟除錯-顯示檢視視窗) <br />Error Log (開啟錯誤記錄檢視視窗) <br />Expressions (開啟除錯-表示式檢視視窗) <br />Java Call Hierarchy (開啟Call Hierarchy檢視視窗) <br />Java Declaration (開啟宣告檢視視窗) <br />Javadoc (開啟Javadoc檢視視窗) <br />Java Members (開啟類別成員檢視視窗) <br />Java Package Explorer (開啟套件瀏覽器) ： Alt+Shift+Q,P &lt;In Windows&gt; <br />Java Packages (開啟Java套件檢視視窗) <br />Java Projects (開啟Java專案檢視視窗) <br />Java Type Hierarchy (開啟類別階層檢視視窗) ： Alt+Shift+Q,T &lt;In Windows&gt; <br />Java Types (開啟Java類別檢視視窗) <br />JUnit (開啟JUnit檢視視窗) <br />Memory (開啟除錯-記憶體檢視視窗) <br />Navigator (開啟導覽器) <br />Outline (開啟概要檢視視窗) ： Alt+Shift+Q,O &lt;In Windows&gt; <br />Plug-in Dependencies (開啟Plug-in Dependencies檢視視窗) <br />Plug-in Registry (開啟Plug-in Registry檢視視窗) <br />Plug-ins (開啟Plug-ins檢視視窗) <br />Problems (開啟問題檢視視窗) ： Alt+Shift+Q,X &lt;In Windows&gt; <br />Progress (開啟執行進度檢視視窗) <br />Properties (org.eclipse.ui.views.Property/Sheet) (開啟屬性檢視視窗) <br />Registers (開啟除錯-暫存器檢視視窗) <br />Search (開啟搜索檢視視窗) ： Alt+Shift+Q,S &lt;In Windows&gt; <br />Synchronize (開啟同步化檢視視窗) ： Alt+Shift+Q,Y &lt;In Windows&gt; <br />Tasks (開啟作業檢視視窗) <br />Threads and Monitors (開啟除錯-執行緒檢視視窗) <br />Variables (開啟除錯-變數檢視視窗) </p>
		<p>◎補充：Views 檢視視窗的開啟處： <br />Window-&gt;Show View-&gt;Other。 </p>
		<p>Window - 視窗 <br />Activate Editor (啟動編輯器) ： F12 &lt;In Windows&gt; <br />Close All Perspectives (關閉全部視景) <br />Close Perspective (關閉視景) <br />Customize Perspective (自訂視景) <br />Hide Editors (隱藏編輯器) <br />Lock the Toolbars (鎖定工具列) <br />Maximize Active View or Editor (編輯區最大化) ： Ctrl+M &lt;In Windows&gt; <br />Next Editor (切換至下一個編輯器) ： Ctrl+F6 &lt;In Windows&gt; <br />Next Perspective (切換至下一個視景) ： Ctrl+F8 &lt;In Windows&gt; <br />Next View (切換至下一個視圖) ： Ctrl+F7 &lt;In Windows&gt; <br />Open Editor Drop Down (以浮動的方式在編輯區，顯示快速切換編輯器功能表) ： Ctrl+E &lt;In Windows&gt; <br />Pin Editor (固定編輯器) <br />Preferences (開啟偏愛設定) <br />Previous Editor (切換至上一個編輯器) ： Ctrl+Shift+F6 &lt;In Windows&gt; <br />Previous Perspective (切換至上一個視景) ： Ctrl+Shift+F8 &lt;In Windows&gt; <br />Previous View (切換至上一個視圖) ： Ctrl+Shift+F7 &lt;In Windows&gt; <br />Reset Perspective (重新設定視景) <br />Save Perspective As (儲存為新視景) <br />Show Ruler Context Menu (顯示尺規的內容功能表) ： Ctrl+F10 &lt;Editing Text&gt; <br />Show Selected Element Only (僅顯示所選元素的程式碼) <br />Show System Menu (顯示系統功能表) ： Alt+- &lt;In Windows&gt; <br />Show View Menu (顯示視圖功能表) ： Ctrl+F10 &lt;In Windows&gt; <br />Switch to Editor (切換至編輯器) ： Ctrl+Shift+E &lt;In Windows&gt; </p>
<img src ="http://www.blogjava.net/ericli1982/aggbug/69453.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-13 20:20 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/13/69453.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>J2EE开发之常用开源项目介绍－－转载（学习）</title><link>http://www.blogjava.net/ericli1982/archive/2006/09/13/69446.html</link><dc:creator>ericli</dc:creator><author>ericli</author><pubDate>Wed, 13 Sep 2006 12:19:00 GMT</pubDate><guid>http://www.blogjava.net/ericli1982/archive/2006/09/13/69446.html</guid><wfw:comment>http://www.blogjava.net/ericli1982/comments/69446.html</wfw:comment><comments>http://www.blogjava.net/ericli1982/archive/2006/09/13/69446.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/ericli1982/comments/commentRss/69446.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ericli1982/services/trackbacks/69446.html</trackback:ping><description><![CDATA[主要还是以Spring为核心,也总结了一些以前web开发常用的开源工具和开源类库<br /> <br />1持久层:        <br />1)Hibernate<br />这个不用介绍了,用的很频繁,用的比较多的是映射,包括继承映射和父子表映射<br />对于DAO在这里介绍个在它基础上开发的包bba96,目前最新版本是bba96 2.0它对Hibernate进行了封装, 查询功能包括执行hsql或者sql查询/更新的方法，如果你要多层次逻辑的条件查询可以自己组装QueryObject.可以参考它做HibernateDAO.也可以直接利用它<br />2) iBATIS<br />另一个ORM工具,没有Hibernate那么集成,自由度比较大,所以使用时普遍性能上比Hibernate要快一些.<br />2:SpringMVC<br />       原理说明和快速入门:<br />       配置文件为:<br />Spring的配置文件默认为WEB-INF/xxxx-servelet.xm其中xxx为web.xml中org.springframework.web.servlet.DispatcherServlet的servlet-name。<br />       Action分发:<br />Spring将按照配置文件定义的URL，Mapping到具体Controller类，再根据URL里的action= xxx或其他参数，利用反射调用Controller里对应的Action方法。<br />输入数据绑定:<br />Spring提供Binder 通过名字的一一对应反射绑定Pojo，也可以直接从request.getParameter()取数据。<br />输入数据验证<br />Sping 提供了Validator接口当然还可以使用开源的Commons-Validaor支持最好<br />Interceptor(拦截器)<br />Spring的拦截器提供接口需要自己编写,在这点不如WebWork做的好.全面 <br />       (这里提一下WebWork和Struts的区别最主要的区别在于WebWork在建立一个Action时是新New一个对象而Struts是SingleMoule所有的都继承它的一个Action,所以根据项目需要合适的选择.)<br />3:View层<br />1) 标签库:JSP2.0/JSTL<br />由于Webwork或Spring的标签确实很有限,一般view层用JSTL标签,而且据说JSTL设计很好速度是所有标签中最快的使用起来也很简单<br /> <br />2) 富客户端:DOJO Widgets, YUI(YahooUI),FCKEditor, Coolest日历控件<br />Dojo主要提供Tree, Tab等富客户端控件,可以用其进行辅助客户端开发<br />YahooUI和DOJO一样它有自己的一套javascript调试控制台,主要支持ajax开发也有很多Tree,Table,Menu等富客户端控件<br />FCKEditor 最流行的文本编辑器<br />Coolest日历控件 目前很多日历控件可用,集成在项目中也比较简单,这个只是其中的一个,界面不错的说..<br /> <br />3) JavaScript:Prototype.js<br />Prototype.js作为javascript的成功的开源框架，封装了很多好用的功能,通过它很容易编写AJAX应用,现在AJAX技术逐渐成熟,框架资源比较丰富,比如YUI,DWR等等,也是因为JavaScript没有合适的调试工具,所以没有必要从零开始编写AJAX应用,个人认为多用一些成熟的Ajax框架实现无刷新更新页面是不错的选择.<br /> <br />4)表格控件:Display Tag ,Extreme Table<br />这两个的功能差不多,都是View层表格的生成,界面也比较相向,可以导出Excel,Pdf,对Spring支持很容易.<br />相比较而言比较推荐ExtremeTable,它的设计很好功能上比DisplayTag多一些,支持Ajax,封装了一些拦截器,而且最方面的是在主页wiki中有详细的中文使用文档.<br /> <br />5):OSCache<br />OSCache是OpenSymphony组织提供的一个J2EE架构中Web应用层的缓存技术实现组件,Cache是一种用于提高系统响应速度、改善系统运行性能的技术。尤其是在Web应用中，通过缓存页面的输出结果，可以很显著的改善系统的稳定性和运行性能。<br />它主要用在处理短时间或一定时间内一些数据或页面不会发生变化,或将一些不变的统计报表,缓冲在内存,可以充分的减轻服务器的压力,防治负载平衡,快速重启服务器(通过硬盘缓存).<br /> <br />6)SiteMesh<br />sitemesh应用Decorator模式主要用于提高页面的可维护性和复用性，其原理是用Filter截取request和response,把页面组件head,content,banner结合为一个完整的视图。通常我们都是用include标签在每个jsp页面中来不断的包含各种header, stylesheet, scripts and footer，现在，在sitemesh的帮助下，我们删掉他们轻松达到复合视图模式.<br />Sitemesh也是 OpenSymphony的一个项目现在最近的版本是2.2,目前OpenSymphony自从04年就没有更新的版本了..感觉它还是比较有创新的一种页面组装方式, OpenSymphony开源组织的代码一般写的比较漂亮,可以改其源代码对自己的项目进行适配.<br />测试发现Sitemesh还存在一些问题,比如中文问题,它的默认编码是iso-8859-1在使用时候需要做一些改动.<br /> <br />7)CSS,XHTML<br />这个不用说了,遵循W3C标准的web页面开发.<br /> <br />8)分页标签: pager-taglib组件<br />Pager-taglib 是一套分页标签库，可以灵活地实现多种不同风格的分页导航页面，并且可以很好的与服务器分页逻辑分离.使用起来也比较简单.<br /> <br />9)Form: Jodd Form taglib<br />Jodd Form taglib使用比较简单,只要把&lt;form&gt;的头尾以&lt;jodd:form bean= "mybean"&gt;包住<br />就会自动绑定mybean, 自动绑定mybean的所有同名属性到普通html标记input, selectbox, checkbox,radiobox.....在这些input框里不用再写任何代码…<br />       <br />10)Ajax:DWR<br />       J2EE应用最常用的ajax框架<br />       <br />       11)报表 图表<br />Eclipse BIRT功能比较强大,也很庞大..好几十M,一般没有特别需求或别的图表设计软件可以解决的不用它<br />JasperReports+ iReport是一个基于Java的开源报表工具，它可以在Java环境下像其它IDE报表工具一样来制作报表。JasperReports支持PDF、HTML、XLS、CSV和XML文件输出格式。JasperReports是当前Java开发者最常用的报表工具。<br />JFreeChart主要是用来制作各种各样的图表，这些图表包括：饼图、柱状图(普通柱状图以及堆栈柱状图)、线图、区域图、分布图、混合图、甘特图以及一些仪表盘等等。<br />       <br /> <br />4:权限控制: Acegi<br />Acegi是Spring Framework 下最成熟的安全系统，它提供了强大灵活的企业级安全服务，如完善的认证和授权机制，Http资源访问控制，Method 调用访问控制等等,支持CAS<br />(耶鲁大学的单点登陆技术,这个单点登陆方案比较出名.我也进行过配置使用,可以根据项目需要,如果用户分布在不同的地方不同的系统通用一套登陆口令可以用它进行解决,一般注册机登陆机就是这样解决的)<br />       Acegi只是于Spring结合最好的安全框架,功能比较强大,当然还有一些其他的安全框架,这里列举一些比较流行的是我从网上找到的,使用方法看其官方文档把…<br />JAAS, Seraph, jSai - Servlet Security, Gabriel, JOSSO, Kasai, jPAM, OpenSAML都是些安全控制的框架..真够多的呵呵<br /> <br />5:全文检索<br />       1) Lucene<br />       Lucene是一套全文索引接口,可以通过它将数据进行倒排文件处理加入索引文件,它的索引速度和查询速度是相当快的,查询百万级数据毫秒级出结果,现在最火的Apache开源项目,版本更新速度很快现在已经到了2.0,每个版本更新的都比较大,目前用的最多的版本应该是1.4.3,但它有个不太方面的地方单个索引文件有2G文件限制,现在2.0版本没有这个限制,我研究的比较多,它的扩展性比较好,可以很方面的扩充其分词接口和查询接口.<br />       基于它的开发的系统很多,比如最常用的Eclipse的搜索功能,还有一些开源的软件比如Compass,Nutch,Lius,还有我最近做的InSearch(企业级FTP文件网页搜索)<br />6:公共Util类<br />       主要是Jakarta-Commons类库,其中最常用得是以下几个类库<br />1) Jakarta-Commons-Language<br />       最常用得类是StringUtils类,提供了使用的字符串处理的常用方法效率比较高<br />2) Jakarta-Commons-Beantuils<br />       主要用Beantuils能够获得反射函数封装及对嵌套属性，map,array型属性的读取。<br />3) Jakarta-Commons-Collections<br />       里面有很多Utils方法<br /> <br />7 日志管理<br />       Log4J<br />       任务是日志记录,分为Info,Warn,error几个层次可以更好的调试程序<br /> <br />8 开源的J2EE框架<br />       1) Appfuse<br />              Appfuse是Matt Raible 开发的一个指导性的入门级J2EE框架, 它对如何集成流行的Spring、Hibernate、iBatis、Struts、Xdcolet、JUnit等基础框架给出了示范. 在持久层，AppFuse采用了Hibernate O/R映射工具；在容器方面，它采用了Spring,用户可以自由选择Struts、Spring/MVC，Webwork，JSF这几个Web框架。<br />       <br />       2) SpringSide<br />       .SpringSide较完整的演示了企业应用的各个方面,是一个电子商务网站的应用 SpringSide也大量参考了Appfuse中的优秀经验。最重要的是它是国内的一个开源项目,可以了解到国内现在的一些实际技术动态和方向很有指导意义…<br /> <br />9:模版 Template <br />主要有Veloctiy和Freemarker<br />模板用Servlet提供的数据动态地生成 HTML。编译器速度快，输出接近静态HTML             页面的速度。<br /> <br />10:工作流<br />       我所知道比较出名的主要有JBpm Shark Osworkflow,由于对它没有过多的研究所以还不是很清楚之间有什么区别.<br /> <br />项目管理软件<br />dotProject:是一个基于LAMP的开源项目管理软件。最出名的项目管理软件<br />JIRA: 项目计划，任务安排，错误管理<br />Bugzilla:提交和管理bug,和eclipse集成,可以通过安装MyEclipse配置一下即可使用<br />BugFree借鉴微软公司软件研发理念、免费开放源代码、基于Web的精简版Bug管理<br />CVS:这个就不介绍了都在用.<br />SVN: SubVersion已逐渐超越CVS，更适应于JavaEE的项目。Apache用了它很久后，Sourceforge刚刚推出SVN的支持。<br />测试用例:主要JUnit单元测试,编写TestCase,Spring也对Junit做了很好的支持<br /> <br />后记:<br />       以Spring为主的应用开发可选用的组件中间件真是眼花缭乱,所以针对不同的项目需求可以利用不同的开源产品解决,比如用Spring+Hibernate/ iBATIS或Spring+WebWork+Hibernate/ iBATIS或Spring+Struts+Hibernate/ iBATIS,合理的框架设计和代码复用设计对项目开发效率和程序性能有很大的提高,也有利于后期的维护.<img src ="http://www.blogjava.net/ericli1982/aggbug/69446.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ericli1982/" target="_blank">ericli</a> 2006-09-13 20:19 <a href="http://www.blogjava.net/ericli1982/archive/2006/09/13/69446.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>