﻿<?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/wjttkx/</link><description>缘来是java</description><language>zh-cn</language><lastBuildDate>Mon, 13 Apr 2026 09:02:51 GMT</lastBuildDate><pubDate>Mon, 13 Apr 2026 09:02:51 GMT</pubDate><ttl>60</ttl><item><title>iframe session,cookie 丢失的问题</title><link>http://www.blogjava.net/wjttkx/archive/2009/11/05/301314.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Thu, 05 Nov 2009 09:10:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2009/11/05/301314.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/301314.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2009/11/05/301314.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/301314.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/301314.html</trackback:ping><description><![CDATA[<p>前提：两个项目A和B，其中项目A登录之后拥有了自己的session，项目B想共用此session，通过项目A的servlet回调项目B的servlet，并给其传递sessionId，在项目B中通过sessionId调用远程接口获取session并赋值给自己的session，项目B再一次发起请求时自己创建的sessionId被改变，session丢失。<br />
解决办法：<br />
在项目B的servlet内加入：Response.AddHeader("P3P","CP=CAO PSA OUR");<br />
原因：ie默认不接受没有标识为安全的第三方cookie，造成不能保存cookie及session。</p>
<img src ="http://www.blogjava.net/wjttkx/aggbug/301314.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2009-11-05 17:10 <a href="http://www.blogjava.net/wjttkx/archive/2009/11/05/301314.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>通过设置ime-mode在页面输入控件中关闭输入法</title><link>http://www.blogjava.net/wjttkx/archive/2007/07/31/133619.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Tue, 31 Jul 2007 09:09:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/07/31/133619.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/133619.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/07/31/133619.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/133619.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/133619.html</trackback:ping><description><![CDATA[<p>有时候要限制用户可输入的内容限制为英文字母和数字，即希望关闭输入法</p>
<p>这时候只要简单的对要限制的控件加上一个ime-mode的css属性即可，如<span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input&nbsp;</span><span style="COLOR: #ff0000">style</span><span style="COLOR: #0000ff">="ime-mode:disabled"</span><span style="COLOR: #0000ff">&gt;</span></p>
<p><span></span></p>
<p><strong>ime-mode</strong> 　　　CSS提议属性</p>
<p>语法：<br><strong>ime-mode : auto | active | inactive | disabled <br></strong>&nbsp;<br>参数：<br><strong>auto</strong> : 不影响IME的状态。与不指定ime-mode属性时相同<br><strong>active</strong> : 指定所有使用IME输入的字符。即激活本地语言输入法。用户仍可以撤销激活IME<br><strong>inactive</strong> : 指定所有不使用IME输入的字符。即激活非本地语言。用户仍可以撤销激活IME<br><strong>disabled</strong> : 完全禁用IME。对于有焦点的控件（如输入框），用户不可以激活IME<br>&nbsp;<br>说明：<br>设置或检索是否允许用户激活输入中文，韩文，日文等的输入法（IME）状态。<br>对应的脚本特性为imeMode。<br>&nbsp;<br>示例：<br>&lt;input type=text style='ime-mode: disabled; '&gt; </p>
<img src ="http://www.blogjava.net/wjttkx/aggbug/133619.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-07-31 17:09 <a href="http://www.blogjava.net/wjttkx/archive/2007/07/31/133619.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>基于模板的Web表示层技术- -</title><link>http://www.blogjava.net/wjttkx/archive/2007/07/26/132567.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Thu, 26 Jul 2007 08:06:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/07/26/132567.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/132567.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/07/26/132567.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/132567.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/132567.html</trackback:ping><description><![CDATA[<p><strong>基于模板的Web表示层技术 (摘自《Spring开发指南》)</strong></p>
<p>传统的JSP技术为Web表现层技术提供了灵活、丰富的功能支持。然而，站在工程的角度<br>而言，过于凌乱的JSP Script也成为系统维护的头号大敌。<br>JSP 代码几乎等同于Java 代码，在提供了最丰富的特性支持的同时，也为系统的开发带<br>来一些隐患，程序员往往天马行空，不为羁束，在JSP 中将业务逻辑、数据逻辑、表现逻辑代<br>码相混杂，代码重用性、系统可维护性极低。<u>特别是在参与开发人员众多，技术水平良莠不齐<br>的情况下，纵使技术经理一再强调设计规范的约束，但人本的约束总是难以控制，随着开发过<br>程进展和产品上线压力的增大，规范约束逐渐薄弱，于是难以避免的造成代码的混乱，可维护<br>性的下降。<br></u>面对这个问题，众多组织和厂商开始研发自己的表现层框架，试图通过一个隔离的表现层<br>框架，强行将表现层和逻辑层相剥离。时间似乎退回到了最初Web 端只支持Servlet 技术的<br>时代（那时候或多或少各个公司都有自己的模板实现）。不过，现在的模板技术经过长时间的<br>发展，已经将表现层的能力发挥得淋漓尽致，不失为JSP技术之外的一个明智选择。</p>
<p><u>模板技术相对传统JSP技术有以下三个主要优势：<br>1． 在技术层面，将表现逻辑与业务逻辑相分离。<br>2． 为人员之间的分工提供了一个良好的分界点。页面美工只需专著关心模板的设计，而程序员则专注于业务逻辑的实现。二者重合点明显减少。<br>3． 如果需要，模板引擎可脱离Web 容器单独运行，这为系统可能的移植需求提供了更多的弹性空间（这一特性在应用中也许并不会有太大的实际意义，只是提供了一种附加选择）。</u></p>
<p>目前Spring支持一下几种模板技术：<br><strong>1． XSLT<br></strong>XSLT是基于XML的表现层模板技术，伴随着XML的大量使用。XSLT也日渐成熟，并<br>迅速成为主流表现层技术之一。<u>XSLT作为一个通用表现层框架，拥有最好的平台适应性，<br>几乎所有的主流程序设计语言都提供了XLST支持，现有的XLST模板可以简单的移植到不<br>同的语言平台</u>，如将J2EE应用中的XSLT移植到.net平台，这样的可移植性是其他专用<br>模板技术，如Velocity和Freemarker难以达到的。<br>笔者在2001年在一个原型项目中采用了XSLT作为表现层实现，由于当时XSLT尚不<br>成熟，XSLT解析器效率低下，因此在正式产品开发中使用其他技术作为替代。在2003年<br>中，经过技术探讨，决定再次在项目实施中引入XSLT 技术，相对两年前，此时的XSLT<br>技术已经相当成熟，解析器的效率也大大改善。经过半年时间的项目研发，产品上线，并<br>取得了令人满意的表现。<u>不过，在之后的项目回顾过程中，笔者认为，目前在项目中大量<br>采用XSLT技术尚不可取，上述项目开发过程中，XSLT技术提供了极佳的扩展性和重用性，<br>也保证了业务逻辑和表示逻辑的清晰划分，然而，最大的问题是，XSLT缺乏强有力的编辑<br>器支持。虽然通过XML/XSLT 技术成全了设计上近乎完美的表现，但却为界面开发带来了<br>极大难度，以至后期复杂界面的修改都需要消耗极大的人力，得不偿失。</u><br>笔者在项目开发中所用的XSLT 编辑器为StylusStudio 和XmlSpy，目前这两款编<br>辑器可以算是XSLT开发的首选，提供了丰富的特性和可视化编辑功能。但即便如此，XLST<br>繁杂苛刻的语法和调试上的难度也为开发工作带来了极大的障碍。<br><u>此外，也许是最重要的一点，xslt在性能上的表现尚不尽如人意。经过多年的发展，<br>XSLT解析/合成器的性能相对最初已经大为改观，但依然与其他模板技术存在着较大差距。<br>据实地测试，FreeMarker和Velocity对于同等复杂度的表现层逻辑，平均处理速度是<br>XSLT 的10 倍以上，这是一个不得不正视的性能沟壑。</u>同时，<u>XSLT 的内存占用也是<br>FreeMarker 和Velocity 的数倍有余（XSLT 中，每个节点都是一个Java 对象，大量<br>对象的存储对内存占用极大，同时大量对象的频繁创建和销毁也对JVM 垃圾收集产生了较<br>大负面影响）。</u>在上述项目中，由于硬件上的充分冗余（8G RAM, 4CPU），才使得这些<br>性能上的影响相对微弱。<br><strong>因此，目前在项目中大量引入XSLT技术尚需仔细考量。<br>2． Velocity<br></strong><u>Velocity是Apache Jakarta项目中的一个子项目，它提供了丰富强大的模板功能。<br>作为目前最为成熟的模板支持实现，Velocity 在诸多项目中得到了广泛应用，不仅<br>限于Web 开发，在众多代码生成系统中，我们也可以看到Velocity 的身影（如<br>Hibernate中的代码生成工具）。<br></u><strong>3． FreeMarker<br></strong>FreeMarker是Velocity之外的另一个模板组件。<br><u>与Velocity 相比，FreeMarker 对表现逻辑和业务逻辑的划分更为严格，<br>Freemarker在模板中不允许对Servlet API进行直接操作（而Velocity可以），<br>如FreeMarker 中禁止对HttpServletRequest 对象直接访问（但可以访问<br>HttpServletRequest对象中的Attribute）。通过更加严格的隔离机制，牵涉逻<br>辑处理的操作被强制转移到逻辑层。从而完全保证了层次之间的清晰性。<br></u>另外一个Velocity无法实现的特性，也是最具备实际意义的特性：<u>FreeMarker对<br>JSP Tag提供了良好支持。</u>这一点可能存在一点争议，JSP技术的最大问题就是容易<br>在页面中混入逻辑代码。而FreeMarker 对JSP Tag 的支持似乎为这个问题又打开<br>了大门。这一点上，我们可以将FreeMarker看作是仅允许使用TAG的JSP页面（实<br>际上，FreeMarker的表达式语法与EL语法也非常类似）。<br><u>从开发角度而言，只允许使用TAG的JSP页面，已经在很大程度上保证了页面表现逻<br>辑与业务逻辑的分离。</u>程序员在JSP Script中混杂逻辑代码的原因，大部分是出于<br>慵懒，只要无法在页面模板中直接编写Java代码，相信程序员也不会去专门编写一个<br>JSP TAG来刻意违反层次划分原则。<br>对JSP TAG 的支持为FreeMarker 带来了极大的活力，目前开源社区中已经有了为<br>数众多的成熟Taglib，如DisplayTag、Struts Menu等，这些功能丰富，成熟可<br>靠的Taglib，将为产品开发提供极大的便利。另一方面，这也为代码重用提供了另一<br>个可选途径，避免了大部分模板实现在这一点上的不足。<br><u>就笔者的经验，对于Web开发而言，FreeMarker在生产效率和学习成本上更具优势，<br>而Velocity 的相对优势在于更多第三方工具的支持和更广泛的开发和用户团体（然<br>而对于一个轻量级模板类库而言，这样的优势并不是十分明显）。<br>如果没有Velocity的技术储备，而又需要通过技术上的限定解决视图/模型的划分问<br>题，这里推荐采用FreeMarker作为Spring MVC中的表现层实现。以获得最好的（学<br>习、开发）成本受益。<br></u></p>
<img src ="http://www.blogjava.net/wjttkx/aggbug/132567.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-07-26 16:06 <a href="http://www.blogjava.net/wjttkx/archive/2007/07/26/132567.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JavaScript中类的实现</title><link>http://www.blogjava.net/wjttkx/archive/2007/07/25/132319.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Wed, 25 Jul 2007 07:27:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/07/25/132319.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/132319.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/07/25/132319.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/132319.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/132319.html</trackback:ping><description><![CDATA[<div class=cnt><strong>理解类的实现机制<br><br></strong>　　在JavaScript中可以使用function关键字来定义一个&#8220;类&#8221;，如何为类添加成员。在函数内通过this指针引用的变量或者方法都会成为类的成员，例如：<br>
<div class=UBBPanel>
<div class=UBBTitle><img style="MARGIN: 0px 2px -3px 0px" alt=程序代码 src="http://www.mxjava.com/blog/images/code.gif"> 程序代码</div>
<div class=UBBContent><br>function class1(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　var s="abc";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　this.p1=s;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　this.method1=function(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　alert("this is a test method");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　}<br>}<br>var obj1=new class1(); <br></div>
</div>
<br>　　通过new class1()获得对象obj1，对象obj1便自动获得了属性p1和方法method1。<br><br>　　在JavaScript中，function本身的定义就是类的构造函数，结合前面介绍过的对象的性质以及new操作符的用法，下面介绍使用new创建对象的过程。<br>　　（1）当解释器遇到new操作符时便创建一个空对象；<br>　　（2）开始运行class1这个函数，并将其中的this指针都指向这个新建的对象；<br>　　（3）因为当给对象不存在的属性赋值时，解释器就会为对象创建该属性，例如在class1中，当执行到this.p1=s这条语句时，就会添加一个属性p1，并把变量s的值赋给它，这样函数执行就是初始化这个对象的过程，即实现构造函数的作用；<br>　　（4）当函数执行完后，new操作符就返回初始化后的对象。<br><br>　　通过这整个过程，JavaScript中就实现了面向对象的基本机制。由此可见，在JavaScript中，function的定义实际上就是实现一个对象的构造器，是通过函数来完成的。这种方式的缺点是：<br>　　&#183;将所有的初始化语句、成员定义都放到一起，代码逻辑不够清晰，不易实现复杂的功能。<br>　　&#183;每创建一个类的实例，都要执行一次构造函数。构造函数中定义的属性和方法总被重复的创建，例如：<br>
<div class=UBBPanel>
<div class=UBBTitle><img style="MARGIN: 0px 2px -3px 0px" alt=程序代码 src="http://www.mxjava.com/blog/images/code.gif"> 程序代码</div>
<div class=UBBContent><br>this.method1=function(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　alert("this is a test method");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br></div>
</div>
<br>　　这里的method1每创建一个class1的实例，都会被创建一次，造成了内存的浪费。下一节介绍另一种类定义的机制：prototype对象，可以解决构造函数中定义类成员带来的缺点。<br><br><br><strong>使用prototype对象定义类成员</strong><br>　　现在介绍另一种为类添加成员的机制：prototype对象。当new一个function时，该对象的成员将自动赋给所创建的对象，例如：<br>
<div class=UBBPanel>
<div class=UBBTitle><img style="MARGIN: 0px 2px -3px 0px" alt=程序代码 src="http://www.mxjava.com/blog/images/code.gif"> 程序代码</div>
<div class=UBBContent><br>＜script language="JavaScript" type="text/javascript"＞<br>＜!--<br>　//定义一个只有一个属性prop的类<br>　function class1(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　this.prop=1;<br>　}<br>　//使用函数的prototype属性给类定义新成员<br>　class1.prototype.showProp=function(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　alert(this.prop);<br>　}<br>　//创建class1的一个实例<br>　var obj1=new class1();<br>　//调用通过prototype原型对象定义的showProp方法<br>　obj1.showProp();<br>//--＞<br>＜/script＞ <br></div>
</div>
<br>　　prototype是一个JavaScript对象，可以为prototype对象添加、修改、删除方法和属性。从而为一个类添加成员定义。<br><br>　　了解了函数的prototype对象，现在再来看new的执行过程。<br>　　（1）创建一个新的对象，并让this指针指向它；<br>　　（2）将函数的prototype对象的所有成员都赋给这个新对象；<br>　　（3）执行函数体，对这个对象进行初始化操作；<br>　　（4）返回（1）中创建的对象。<br><br>　　和new的执行过程相比，多了用prototype来初始化对象的过程，这也和prototype的字面意思相符，它是所对应类的实例的原型。这个初始化过程发生在函数体（构造器）执行之前，所以可以在函数体内部调用prototype中定义的属性和方法，例如：<br>
<div class=UBBPanel>
<div class=UBBTitle><img style="MARGIN: 0px 2px -3px 0px" alt=程序代码 src="http://www.mxjava.com/blog/images/code.gif"> 程序代码</div>
<div class=UBBContent><br>＜script language="JavaScript" type="text/javascript"＞<br>＜!--<br>//定义一个只有一个属性prop的类<br>function class1(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　this.prop=1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　this.showProp();<br>}<br>//使用函数的prototype属性给类定义新成员<br>class1.prototype.showProp=function(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　alert(this.prop);<br>}<br>//创建class1的一个实例<br>var obj1=new class1();<br>//--＞<br>＜/script＞ <br></div>
</div>
<br>　　和上一段代码相比，这里在class1的内部调用了prototype中定义的方法showProp，从而在对象的构造过程中就弹出了对话框，显示prop属性的值为1。<br><br>　　需要注意，原型对象的定义必须在创建类实例的语句之前，否则它将不会起作用，例如：<br>
<div class=UBBPanel>
<div class=UBBTitle><img style="MARGIN: 0px 2px -3px 0px" alt=程序代码 src="http://www.mxjava.com/blog/images/code.gif"> 程序代码</div>
<div class=UBBContent><br>＜script language="JavaScript" type="text/javascript"＞<br>＜!--<br>//定义一个只有一个属性prop的类<br>function class1(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　this.prop=1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　this.showProp();<br>}<br>//创建class1的一个实例<br>var obj1=new class1();<br>//在创建实例的语句之后使用函数的prototype属性给类定义新成员，只会对后面创建的对象有效<br>class1.prototype.showProp=function(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　alert(this.prop);<br>}<br>//--＞<br>＜/script＞ <br></div>
</div>
<br>　　这段代码将会产生运行时错误，显示对象没有showProp方法，就是因为该方法的定义是在实例化一个类的语句之后。<br><br>　　由此可见，prototype对象专用于设计类的成员，它是和一个类紧密相关的，除此之外，prototype还有一个重要的属性：constructor，表示对该构造函数的引用，例如：<br>
<div class=UBBPanel>
<div class=UBBTitle><img style="MARGIN: 0px 2px -3px 0px" alt=程序代码 src="http://www.mxjava.com/blog/images/code.gif"> 程序代码</div>
<div class=UBBContent><br>function class1(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　alert(1);<br>}<br>class1.prototype.constructor(); //调用类的构造函数 <br></div>
</div>
<br>　　这段代码运行后将会出现对话框，在上面显示文字&#8220;1&#8221;，从而可以看出一个prototype是和一个类的定义紧密相关的。实际上：class1.prototype.constructor===class1。<br><br><br><strong>一种JavaScript类的设计模式</strong><br><br>　　前面已经介绍了如何定义一个类，如何初始化一个类的实例，且类可以在function定义的函数体中添加成员，又可以用prototype定义类的成员，编程的代码显得混乱。如何以一种清晰的方式来定义类呢？下面给出了一种类的实现模式。<br><br>　　在JavaScript中，由于对象灵活的性质，在构造函数中也可以为类添加成员，在增加灵活性的同时，也增加了代码的复杂度。为了提高代码的可读性和开发效率，可以采用这种定义成员的方式，而使用prototype对象来替代，这样function的定义就是类的构造函数，符合传统意义类的实现：类名和构造函数名是相同的。例如：<br>
<div class=UBBPanel>
<div class=UBBTitle><img style="MARGIN: 0px 2px -3px 0px" alt=程序代码 src="http://www.mxjava.com/blog/images/code.gif"> 程序代码</div>
<div class=UBBContent><br>function class1(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　//构造函数<br>}<br>//成员定义<br>class1.prototype.someProperty="sample";<br>class1.prototype.someMethod=function(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　//方法实现代码<br>}&nbsp;&nbsp;<br></div>
</div>
<br>　　虽然上面的代码对于类的定义已经清晰了很多，但每定义一个属性或方法，都需要使用一次class1.prototype，不仅代码体积变大，而且易读性还不够。为了进一步改进，可以使用无类型对象的构造方法来指定prototype对象，从而实现类的成员定义：<br>
<div class=UBBPanel>
<div class=UBBTitle><img style="MARGIN: 0px 2px -3px 0px" alt=程序代码 src="http://www.mxjava.com/blog/images/code.gif"> 程序代码</div>
<div class=UBBContent><br>//定义一个类class1<br>function class1(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　//构造函数<br>}<br>//通过指定prototype对象来实现类的成员定义<br>class1.prototype={<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　someProperty:"sample",&nbsp;&nbsp; someMethod:function(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　//方法代码<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　},<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　&#8230;//其他属性和方法.<br>} <br></div>
</div>
<br>　　上面的代码用一种很清晰的方式定义了class1，构造函数直接用类名来实现，而成员使用无类型对象来定义，以列表的方式实现了所有属性和方法，并且可以在定义的同时初始化属性的值。这也更象传统意义面向对象语言中类的实现。只是构造函数和类的成员定义被分为了两个部分，这可看成JavaScript中定义类的一种固定模式，这样在使用时会更加容易理解。<br><br>　　注意：在一个类的成员之间互相引用，必须通过this指针来进行，例如在上面例子中的someMethod方法中，如果要使用属性someProperty，必须通过this.someProperty的形式，因为在JavaScript中每个属性和方法都是独立的，它们通过this指针联系在一个对象上。 </div>
<img src ="http://www.blogjava.net/wjttkx/aggbug/132319.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-07-25 15:27 <a href="http://www.blogjava.net/wjttkx/archive/2007/07/25/132319.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>配置Struts2.0  启动taomcat时异常</title><link>http://www.blogjava.net/wjttkx/archive/2007/07/06/128649.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Fri, 06 Jul 2007 09:54:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/07/06/128649.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/128649.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/07/06/128649.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/128649.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/128649.html</trackback:ping><description><![CDATA[<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="COLOR: red; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><strong style="COLOR: #000000">异常信息：</strong></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:42 org.apache.coyote.http11.Http11AprProtocol init</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Initializing Coyote HTTP/1.1 on http-9090</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:42 org.apache.coyote.ajp.AjpAprProtocol init</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Initializing Coyote AJP/1.3 on ajp-8009</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:42 org.apache.catalina.startup.Catalina load</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Initialization processed in 2164 ms</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:43 org.apache.catalina.core.StandardService start</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Starting service Catalina</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:43 org.apache.catalina.core.StandardEngine start</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Starting Servlet Engine: Apache Tomcat/<st1:chsdate w:st="on" Year="1899" Month="12" Day="30" IsLunarDate="False" IsROCDate="False">5.5.23</st1:chsdate></span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:43 org.apache.catalina.core.StandardHost start</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: XML validation disabled</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">log4j:WARN Please initialize the log4j system properly.</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:50 org.apache.catalina.core.StandardContext start</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">严重</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Error filterStart<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:50 org.apache.catalina.core.StandardContext start<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">严重</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Context [/BookManage] startup failed due to previous errors<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:51 org.apache.catalina.core.ApplicationContext log</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: ContextListener: contextInitialized()</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:51 org.apache.catalina.core.ApplicationContext log</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: SessionListener: contextInitialized()</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:52 org.apache.catalina.core.ApplicationContext log</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: ContextListener: contextInitialized()</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:52 org.apache.catalina.core.ApplicationContext log</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: SessionListener: contextInitialized()</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:47:57 org.apache.catalina.loader.WebappClassLoader validateJarFile</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: validateJarFile(C:\Tomcat 5.5\webapps\TopHyTree\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section <st1:chsdate w:st="on" Year="1899" Month="12" Day="30" IsLunarDate="False" IsROCDate="False">9.7.2</st1:chsdate>. Offending class: javax/servlet/Servlet.class</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">log4j:WARN Please initialize the log4j system properly.</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:48:01 org.apache.coyote.http11.Http11AprProtocol start</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Starting Coyote HTTP/1.1 on http-9090</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:48:02 org.apache.coyote.ajp.AjpAprProtocol start</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Starting Coyote AJP/1.3 on ajp-8009</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:48:03 org.apache.catalina.storeconfig.StoreLoader load</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Find registry server-registry.xml at classpath resource</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">2007-5-16 10:48:03 org.apache.catalina.startup.Catalina start</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">信息</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">: Server startup in 20835 ms<br><o:p></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">红色字体为出错信息，原来以为是用</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">Filter</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">（过滤器或者拦截器）出错，因为把<font color=#333333>把<span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">web.xml</span></font><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">里的</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">filter</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">配置去掉，就正常起来了，</span>在网上查找发现两种情况：</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 19.5pt; TEXT-INDENT: -19.5pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list 19.5pt" align=left><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'"><font face="Courier New">&nbsp; &nbsp; 1、</font>运用</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">Filte</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">包不齐全<br></span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'"><font face="Courier New">&nbsp;2、</font>第二种情况：</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">google</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">里搜索</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">Error filterStart</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">里有个文章说</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">tomcat</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">里的</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">bug,</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">没有实现</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">javax.servlet.Filter</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">的</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">Filter</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">会报这样的错误：</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align=left><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">看来</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">tomcat</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">在启动就初始化</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">Filter</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">实例了，可能是</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">Filter</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">里的啥东东执行出错导致可能，看看</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">Filter</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">的</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">init</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">里用到一句</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">mServ = (ModuleService)WebUtils.getApplicationContext(config.getServletContext()).getBean("moduleService");<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align=left><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">是最可能发生错误了，因为这里用到了</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">spring</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">的</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">org.springframework.web.context.ContextLoaderServlet</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">，如果启动这时还没有建立该</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">servlet</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">实例，务必导致获取失败，抛出错误。先屏蔽一下这句话，果真启动正常了，修改一下代码，将</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">init</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">里的这句话丢到了</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">doFilter</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">里面</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(mServ==null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mServ = (ModuleService)WebUtils.getApplicationContext(filterConfig.getServletContext()).getBean("moduleService");</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align=left><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">不过</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">Tomcat</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">也真是，解析</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">web.xml</span><span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体">的顺序上还是太僵硬了。</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">我的出错情况：</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">经仔细推敲查找发现是</span><span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">配置文件</span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">struts.xml配置时候action文件名错误</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=3><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">原因：</span><span lang=EN-US><font face="Times New Roman">tomcat</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启动时会通过</span><span lang=EN-US><font face="Times New Roman">web.xml</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件</span></font><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">寻找</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">struts.xml</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">文件。</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">又因</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">struts2.0</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">默认有拦截器的，所以如果这里的有错误信息，就会报</span><span lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">Filter</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'">错误，很容易引起误导。</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left></o:p></span></p>
<img src ="http://www.blogjava.net/wjttkx/aggbug/128649.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-07-06 17:54 <a href="http://www.blogjava.net/wjttkx/archive/2007/07/06/128649.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>js中innerHTML与innerText的用法与区别</title><link>http://www.blogjava.net/wjttkx/archive/2007/06/25/126013.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Mon, 25 Jun 2007 00:31:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/06/25/126013.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/126013.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/06/25/126013.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/126013.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/126013.html</trackback:ping><description><![CDATA[<div>
<p>用法：<br><br>&lt;div&nbsp;id="test"&gt;<br>&nbsp;&nbsp;&nbsp;&lt;span&nbsp;style="color:red"&gt;test1&lt;/span&gt;&nbsp;test2<br>&lt;/div&gt;<br><br>在JS中可以使用：<br><br><strong>test.innerHTML</strong>:</p>
<p>　　也就是从对象的起始位置到终止位置的全部内容,包括Html标签。</p>
<p>　　上例中的test.innerHTML的值也就是&#8220;&lt;span&nbsp;style="color:red"&gt;test1&lt;/span&gt;&nbsp;test2 &#8221;。<br><br><strong>test.innerText:</strong>&nbsp;</p>
<p>　　从起始位置到终止位置的内容,&nbsp;但它去除Html标签&nbsp;</p>
<p>　　上例中的text.innerTest的值也就是&#8220;test1&nbsp;test2&#8221;,&nbsp;其中span标签去除了。</p>
<p><strong>test.outerHTML:</strong></p>
<p><strong>　　</strong>除了包含innerHTML的全部内容外,&nbsp;还包含对象标签本身。</p>
<p>　　上例中的text.outerHTML的值也就是&lt;div&nbsp;id="test"&gt;&lt;span&nbsp;style="color:red"&gt;test1&lt;/span&gt;&nbsp;test2&lt;/div&gt;</p>
<p><strong><br>完整示例：</strong></p>
<p>&lt;div&nbsp;id="test"&gt;<br>&nbsp;&nbsp;&nbsp;&lt;span&nbsp;style="color:red"&gt;test1&lt;/span&gt;&nbsp;test2<br>&lt;/div&gt;<br><br>&lt;a href="javascript:alert(test.innerHTML)"&gt;innerHTML内容&lt;/a&gt;<br>&lt;a href="javascript:alert(test.innerText)"&gt;inerHTML内容&lt;/a&gt;<br>&lt;a href="javascript:alert(test.outerHTML)"&gt;outerHTML内容&lt;/a&gt;<br><br><strong>特别说明：</strong></p>
<p><strong>　　</strong>innerHTML是符合W3C标准的属性，而innerText只适用于IE浏览器，因此，尽可能地去使用innerHTML，而少用innerText，如果要输出不含HTML标签的内容，可以使用innerHTML取得包含HTML标签的内容后，再用正则表达式去除HTML标签，下面是一个简单的符合W3C标准的示例：<br><br>&lt;a href="javascript:alert(document.getElementById('test').innerHTML.replace(/&lt;.+?&gt;/gim,''))"&gt;无HTML,符合W3C标准&lt;/a&gt;<br></p>
</div>
<img src ="http://www.blogjava.net/wjttkx/aggbug/126013.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-06-25 08:31 <a href="http://www.blogjava.net/wjttkx/archive/2007/06/25/126013.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于event.cancelBubble的描述</title><link>http://www.blogjava.net/wjttkx/archive/2007/06/20/125262.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Wed, 20 Jun 2007 02:44:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/06/20/125262.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/125262.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/06/20/125262.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/125262.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/125262.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 由于HTML中的对象都是层次结构，比如一个Table包含了多个TR，一个TR包含了多个TD. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bubble就是一个事件可以从子节点向父节点传递，简单的讲就是他的父级以上的东西的事件不触发。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 例子：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script&nbsp;&nbsp; language="javascript"&gt;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function&nbsp;&nbsp; document.onclick()&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;{&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("in&nbsp;&nbsp; the&nbsp;&nbsp; document's&nbsp;&nbsp; event&nbsp;&nbsp; handler!");&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function&nbsp;&nbsp; clickMe()&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("in&nbsp;&nbsp; the&nbsp;&nbsp; button's&nbsp;&nbsp; event&nbsp;&nbsp; handler!");&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;// event.cancelBubble&nbsp;&nbsp; =&nbsp;&nbsp; true;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/script&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input&nbsp;&nbsp; type="button"&nbsp;&nbsp; value="click&nbsp;&nbsp; me"&nbsp;&nbsp; onclick="clickMe()"&gt; 
<img src ="http://www.blogjava.net/wjttkx/aggbug/125262.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-06-20 10:44 <a href="http://www.blogjava.net/wjttkx/archive/2007/06/20/125262.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转发]MYSQL常用指令</title><link>http://www.blogjava.net/wjttkx/archive/2007/06/14/124343.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Thu, 14 Jun 2007 08:36:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/06/14/124343.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/124343.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/06/14/124343.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/124343.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/124343.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp; 感觉很有必要参考的，就转发过来了：
<div id=art style="MARGIN: 15px" width="100%">
<p>unsigned int <br>auto_increment 自动增长<br>not null&nbsp; 非空<br>tinyint(m)<br>float(m,n) m 总长 n 小数点后的位数<br>mysqld --console 开始<br>Mysqld (start)<br>Mysqld-nt<br>CREATE DATABASE db_name 创建数据库<br>USE db_name(选取数据库)<br>Mysql 管理<br>mysqladmin<br>Show databases 查看</p>
<p>mysql -h(hostname) -u(username) -p(要求输入密码的)<br>quit 退出</p>
<p>1、show tables </p>
<p>2、mysqladmin shutdown 关闭</p>
<p>3、mysql --h=hostname --u=username --p</p>
<p>4、DROP DATABASE db_name&nbsp; 删除</p>
<p>5、DROP TABLE 表的名字&nbsp;&nbsp;&nbsp; </p>
<p>6、CREATE TABLE 表的名字 SELECT （要选择的列） FROM 原来的表 WHERE condition;</p>
<p>7、CREATE TABLE new_table SELECT id,name,sex FROM</p>
<p>8、INSERT INTO 表的名字 VALUES 跟的值（&#8216;列的值&#8217;，&#8216;列的值&#8217;）；</p>
<p>9、drop database name(数据库的名字） 删除数据库<br>10、CREATE TABLE name (id int,name varchar(20),sex ENUM('male','female'))创建表</p>
<p>11、DESCRIBE TABLE(表的名字）</p>
<p>12、ALTER TABLE name（表的名字）ADD PRIMARY KEY （index_col_name）； 建表的主键</p>
<p>13、ALTER TABLE name（表的名字）MODIFY id int(11) unsuptaigned(非负） not null（非空） auto_intcrement（自动增长）;</p>
<p>14、select * from 表的名字；</p>
<p>&nbsp;&nbsp;&nbsp; SELECT Name, Population FROM City ORDER BY Population DESC LIMIT 5;</p>
<p>15、update 表的名字 set 列的名字='数据' where id=号码； 修改和增加数据</p>
<p>16、ALTER TABLE 表的名字 ADD 列名 类型 ； 增加一个列</p>
<p>17、LOAD DATA INFILE &#8216;路径，文件名&#8217;INTO TABLE 表名；&nbsp;&nbsp;&nbsp; 导入数据</p>
<p>修改记录：UPDATE table_name SET column_name_1=column_value_1[,column_name2=column_value2] [WHERE where_statement] [LIMIT n];<br>例: UPDATE xscj SET YuWen=80 WHERE id=101 (int型不要&#8216;&#8217;，char 型要&#8217;&#8216;）<br>删除记录：DELETE FROM table_name [WHERE where_statements][LIMIT n];<br>DELETE FROM xscj WHERE id=101;<br>CREATE TABLE 表的名字 SELECT 要选择的列或* FROM 原表名 WHERE id=..(只提取一条记录）默认为全部 <br>INSERT INTO 表名 VALUES （与表对应的数值）；插入多个值（），（）SELECT * FROM 表名；<br>有些关键字可以用``标起来&nbsp;&nbsp; 例如：`all`</p>
<p>18、创建索引：<br>CREATE TABLE 表名 (id init,name varchar(20)) INDEX idx_id(id) PRIMARY KEY id<br>CREATE INDEX part_of_name ON customer (name(10));</p>
<p>19、ALTER TABLE 表名 ADD INDEX idx_id (id,name); 修改索引；</p>
<p>20、ALTER TABLE 表名 DROP INDEX idx_id(索引的名字) 删除索引</p>
<p>order by (DESC(降序)) 排序</p>
<p>select TOP 3(前三行) student_id,name from xscj where student_id between 123 AND 1323 order by students_id ,name desc <br>SELECT student_id , count(*) AS ss FROM xscj GROUP BY student_id;<br>count(*) 记录行数<br>ab[123].com=ab1.com or ab2.com or ab3.com<br>mysql mytest &lt; c:\study.txt&nbsp; 导入文件</p>
<p>临时表<br>可用CREATE TEMPORARY TABLE 来创建临时表，这些表在会话结束时会自动消失。使用临时表很方便，<br>因为不必费心发布DROP TABLE 语句明确地删除这些表，而且如果您的会话不正常结束，这些表不会滞留<br>。例如，如果某个文件中有一个用mysql运行的查询，您决定不等到其结束，那么可以在其执行的中途停<br>止这个查询，而且毫无问题，服务器将删除所创建的任意临时表。在旧版的MySQL中，没有真正的临时表<br>，除了您在自己的头脑中认为它们是临时的除外。对于需要这样的表的应用程序，必须自己记住删除这些<br>表。如果忘了删除，或在前面使其存在的客户机中出现错误时，这些表在有人注意到并删除它们以前会一<br>直存在。临时表仅对创建该表的客户机可见。</p>
<p>DROP TABLE tb1_name1,tb1_name2,......<br>? ? 其次，如果不能肯定一个表是否存在，但希望如果它存<br>在就删除它。那么可在此语句中增加IF EXISTS。</p>
<p>SELECT a,b,a+b INTO OUTFILE 'c:/result.text' FIELDS TERMINATED BY "" LINES TERMINATED BY "\n" FROM test_table;<br>SELECT user,MAX(salary) AS sum FROM users group by user HAVING sum&gt;10 LIMIT 95,-1(95到最后);<br>@c:\study.sql 可以查看系统<br>&nbsp;<br>SELECT * FROM table1 USE INDEX (key1,key2) WHERE key1=1 AND key2=2 AND key3=3;<br>&nbsp;主键与负键的联系用 references</p>
<p>mysql数据库的授权 <br>　　 mysql&gt;grant select,insert,delete,create,drop <br>　　 on *.* (或test.*/user.*/..) <br>　　 to 用户名@localhost <br>　　 identified by 密码； <br>　　 如：新建一个用户帐号以便可以访问数据库，需要进行如下操作： <br>　　 mysql&gt; grant usage（没有权限） <br>　　 -&gt; ON test.* <br>　　 -&gt; TO <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#116;&#101;&#115;&#116;&#117;&#115;&#101;&#114;&#64;&#108;&#111;&#99;&#97;&#108;&#104;&#111;&#115;&#116;"><u><font color=#0000ff>testuser@localhost</font></u></a>; <br>　　 Query OK, 0 rows affected (0.15 sec) <br>　　 此后就创建了一个新用户叫：testuser，这个用户只能从localhost连接到数据库并可以连接到test 数据库。下一步，我们必须指定testuser这个用户可以执行哪些操作： <br>　　 mysql&gt; GRANT select, insert, delete,update <br>　　 -&gt; ON test.* <br>　　 -&gt; TO <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#116;&#101;&#115;&#116;&#117;&#115;&#101;&#114;&#64;&#108;&#111;&#99;&#97;&#108;&#104;&#111;&#115;&#116;"><u><font color=#0000ff>testuser@localhost</font></u></a>; <br>　　 Query OK, 0 rows affected (0.00 sec) <br>　　 此操作使testuser能够在每一个test数据库中的表执行SELECT，INSERT和DELETE以及UPDATE查询操作。现在我们结束操作并退出MySQL客户程序： <br>　　 mysql&gt; exit <br>　　 Bye <br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; 登陆：mysql -u &nbsp;用户名 -p <br>&nbsp;&nbsp;&nbsp;&nbsp; 删除用户 delete from user where user='名字1' [or user='名字2']；<br>&nbsp;&nbsp;&nbsp;&nbsp; user 数据库是系统的<br>&nbsp;<br>运行脚本：<br>修改密码：<br>USE mysql;<br>UPDATE user SET Password(字段名)=PASSWORD（一个函数）('new_password') WHERE user='root'</p>
<p>FLUSH PRIVILEGES；（你必须告诉服务器再次读入授权表）</p>
<p>Mysqldump 数据库备份<br>mysqldump -u -p 数据库名[表名]&gt;（重定向）<br>mysqldump&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</p>
</div>
<img src ="http://www.blogjava.net/wjttkx/aggbug/124343.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-06-14 16:36 <a href="http://www.blogjava.net/wjttkx/archive/2007/06/14/124343.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>sql内、外、左、右连接</title><link>http://www.blogjava.net/wjttkx/archive/2007/06/08/122913.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Fri, 08 Jun 2007 10:12:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/06/08/122913.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/122913.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/06/08/122913.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/122913.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/122913.html</trackback:ping><description><![CDATA[在数据库应用中，经常要涉及从两个或更多的表中查询数据，这就需要使用连接查询。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 其格式如下：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT COLUMN_NAME，C O L U M N _ N A M E [ , . . . n ]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM TA B L E _ N A M E，TA B L E _ N A M E [ , . . . n ]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE TABLE_NAME.COLUMN_NAME JOIN_OPERATOR TA B L E _ N A M E . C O L U M N _ N A M E<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 上述的连接操作符（J O I N _ O P E R ATO R）可以是：=、&gt;、&lt;、&gt; =、&lt; =、! =、&lt; &gt;、! &gt;、! &lt;、= *、* =。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在A N S I中，&#8220;=&#8221;连接应该写成Inner Join；&#8220;* =&#8221;连接应该写成LEFT OUT JOIN；&#8220;= *&#8221;连接应该写成&#8220; RIGHT OUT JOIN&#8221;。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在SQL SERVER中，这些写法都可以用。但是，A N S I规定的写法是INNER JOIN等标志。一般而言，在任何连接中，都使用&#8220;主键=外键&#8221;的连接查询条件。<br>---------------------------------------------------------------------------------<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 非限制连接（CROSS JOIN），就是指不带W H E R E子句的查询。在数学上，就是表的笛卡尔积。若R表和S表非限制连接，而且R表有X行，S表有Y行，那么结果集是X * Y行。即：R表的一行对应着S表的所有行。在应用中，非限制连接产生的是无意义结果集，但在数据库的数学模式上有重要的作用。<br>-------------------------------------------------------------------------<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 自然连接（INNER JOIN）也叫内连接。我们先看下面的例子：<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT PUB_NAME,TITLE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM TITLES,PUBLISHERS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE TITLES.PUB_ID=PUBLISHERS.PUB_ID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 或写成：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT PUB_NAME,TITLE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM TITLES INNER JOIN PUBLISHERS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON TITLES.PUB_ID=PUBLISHERS.PUB_ID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 其中，INNER JOIN是SQL Server的缺省连接，可简写为J O I N。在J O I N后面指定哪些表作连接。O N后面指定了连接的条件。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 以上操作的过程如下：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1) 从T I T L E S表中取出一条符合其条件的记录。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2) 扫描P U B L I S H E R S表，分别检查每条记录是否在连接属性上同表T I T L E S取出的记录相<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3) 相等就显示信息。继续从表T I T L E S中取下一条记录，重复步骤2。其实，两个或多个表要做连接，那么这些表之间必然存在着主键和外键的关系。所以，只需要将这些键的关系列出，就可以得出表连接的结果。如上例中， P U B _ I D是P U B L I S H E R S表的主键， P U B_ I D又是TI T L E S表的外键，参照P U B L I S H E R S表中的P U B _ I D .所以，这两个表的连接条件就是T I T L E S.PUB_ID=PUBLISHERS. PUB_ID。<br>-----------------------------------------------------------------------<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 外连接（OUTER JOIN）允许限制一张表中的行，而不限制另一张表中的行。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下面举两个例子来说明外连接的用法。请比较这两个例子。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 例显示所有的书名（无销售记录的书也包括在内，&#8220;*&#8221;在左边表示不限制左边表的数<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT TITLES.TITLE_ID,title=convert(char(38),TITLE),QTY<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM TITLES,SALES<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE TITLES.TITLE_ID *= SALES.TITLE_ID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 或写为：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT TITLES.TITLE_ID,title=convert(char(38),TITLE),QTY<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM TITLES LEFT OUTER JOIN SALES<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON TITLES.TITLE_ID = SALES.TITLE_ID<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 外连接的方法有两种:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8226; A *= B 包括第一张表A的所有行在内，而不考虑语句限制（如： A . t i t l e _ i d = B . t i t l e _ i d）。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 相当于LEFT OUT JOIN。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8226; A =* B 包括第二张表B的所有行在内，而不考虑语句限制（如： A . t i t l e _ i d = B . t i t l e _ i d）。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 相当于RIGHT OUT JOIN。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 创建外连接规则：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1) 外连接显示外部表中的所有行，包括与相关表不相配的行在内。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2) 外连接只能在两张表之间进行。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3) 不能在内部表上使用IS NULL检索条件。
<img src ="http://www.blogjava.net/wjttkx/aggbug/122913.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-06-08 18:12 <a href="http://www.blogjava.net/wjttkx/archive/2007/06/08/122913.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>初学webwork遇到的异常</title><link>http://www.blogjava.net/wjttkx/archive/2007/06/08/122911.html</link><dc:creator>落落</dc:creator><author>落落</author><pubDate>Fri, 08 Jun 2007 10:11:00 GMT</pubDate><guid>http://www.blogjava.net/wjttkx/archive/2007/06/08/122911.html</guid><wfw:comment>http://www.blogjava.net/wjttkx/comments/122911.html</wfw:comment><comments>http://www.blogjava.net/wjttkx/archive/2007/06/08/122911.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wjttkx/comments/commentRss/122911.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wjttkx/services/trackbacks/122911.html</trackback:ping><description><![CDATA[<p>初学webwork，遇到此异常</p>
<p>严重: Servlet.service() for servlet webwork threw exception<br>java.lang.NoClassDefFoundError: com/uwyn/rife/continuations/ContinuationConfig<br>at com.opensymphony.webwork.dispatcher.mapper.ActionMapperFactory.getMapper(ActionMapperFactory.java:32)<br>at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:93)<br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)<br>at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)<br>at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)<br>at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)<br>at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)<br>at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)<br>at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)<br>at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)<br>at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)<br>at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834)<br>at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)<br>at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)<br>at java.lang.Thread.run(Thread.java:595)</p>
<p>刚开始以为是配置问题，后来把所有的jar包导进去，ok了，经查看少包：rrife-continuations.jar <br></p>
<img src ="http://www.blogjava.net/wjttkx/aggbug/122911.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wjttkx/" target="_blank">落落</a> 2007-06-08 18:11 <a href="http://www.blogjava.net/wjttkx/archive/2007/06/08/122911.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>