??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕一区二区三区av,7777精品伊人久久久大香线蕉经典版下载 ,日韩精品一区二区三区视频在线观看http://www.aygfsteel.com/pitey/archive/2009/02/11/254198.htmlPiteyPiteyWed, 11 Feb 2009 01:52:00 GMThttp://www.aygfsteel.com/pitey/archive/2009/02/11/254198.htmlhttp://www.aygfsteel.com/pitey/comments/254198.htmlhttp://www.aygfsteel.com/pitey/archive/2009/02/11/254198.html#Feedback0http://www.aygfsteel.com/pitey/comments/commentRss/254198.htmlhttp://www.aygfsteel.com/pitey/services/trackbacks/254198.html江南白衣 
  
    一直希望那些J字头的协议能有几个提前告老还乡的Q好减轻一下我们的负担Q特别是qWebService满天飞的时代。但gq有很久都轮不到JMS的消失:

    1.因ؓ
    1.它是《Effective Enterprise Java》的一个实c?#160;
    可以把不影响用户执行l果又比较耗时的Q务(比如发邮仉知理员)异步的扔lJMS 服务端去做,而尽快的把屏q返q给用户?br />     而且服务端能够多U程排队响应--高ƈ发的h?br />
    2. 可以在Java世界里达到最高的解耦?br />        ҎWebServiceQJMS的客L与服务端无需直连Q甚x需知晓Ҏ是谁、在哪里、有多少人,只要Ҏq的信息作响应就行了。对牵一发动全n的企业应用来说很ȝ?br />        
     2. 但是
     1. Message Bean带着EJBpȝ荣光Q步骤比较繁杂,你需要实现MessageDrivenBean、MessageListener接口Q还需要设|EJB的配|信息,然后是deploy....

     2. Spring 1.x 提供的JMS Template化了JMS Client端的~程Q但q没有涉及到服务端的攚w?br />
     3. 所以,SpringSide的Message Driven POJOҎ

      Spring JMS Template + ActiveMQ + Jencks

1. 它是Lightweight的,基本上只是普通POJOQ不用搞太多东西?/p>

2. 它是Spring Base的,可以使用Spring的各U特性如IOC、AOP?/p>

3. 它是Effective的,ZJencks的JCA Container实现 pool connectionQcontrol transactions and manage security?/p>

4. 但它是withdout EJB Container的?br />
其实它还不是100% POJOQ除非再用上LingoQ但我已不想走得太远?br />
4.黄金版配|?br />       如果你想找一个ActiveMQ 3.2 Stable?Spring?00%可行的配|文Ӟ估计只能?a target="_blank">SpringSide目里看了。网上的文章Q不是已q时Q就是不切题?br />
     推荐中英两䆾最接近的文档:
     L慈朋(IDEA中国): Spring和Message Bean的整?/a>
    
Spring loaded:  Message-Driven POJOs 

     不过它们都有个outdate的地?-ActiveMQ3.2开始不再自带JCA Cotainer了,而是其与Gernimo 合作而成了JencksQ需另外安装?br />
 5.SpringSide旅游指南

      pom.xml里的JMS部分 --所需的依赖包?br />       applicationContext-jms.xml --黄金版配|文件?br />       activemq.xml  --AcitveMQ Broker配置文g?br />       OrderPlaceMDP.java --Message Driven Pojo?br />       JmsTest.java --单元试用例?br />       OrderManger.java的NodifyOrder()函数 --实际应用的地斏V?#160;

 POJO太简单,唯一ȝ的配|文件已注释Q这里也无话了?/p>

Pitey 2009-02-11 09:52 发表评论
]]>
[导入]一ơJava垃圾攉调优实战http://www.aygfsteel.com/pitey/archive/2009/02/11/254176.htmlPiteyPiteyWed, 11 Feb 2009 01:17:00 GMThttp://www.aygfsteel.com/pitey/archive/2009/02/11/254176.htmlhttp://www.aygfsteel.com/pitey/comments/254176.htmlhttp://www.aygfsteel.com/pitey/archive/2009/02/11/254176.html#Feedback0http://www.aygfsteel.com/pitey/comments/commentRss/254176.htmlhttp://www.aygfsteel.com/pitey/services/trackbacks/254176.html阅读全文

江南白衣 2008-07-09 10:13 发表评论

文章来源:http://www.aygfsteel.com/calvin/archive/2008/07/09/213535.html

Pitey 2009-02-11 09:17 发表评论
]]>
Spring事物拦截器学习笔?/title><link>http://www.aygfsteel.com/pitey/archive/2009/02/10/254143.html</link><dc:creator>Pitey</dc:creator><author>Pitey</author><pubDate>Tue, 10 Feb 2009 15:07:00 GMT</pubDate><guid>http://www.aygfsteel.com/pitey/archive/2009/02/10/254143.html</guid><wfw:comment>http://www.aygfsteel.com/pitey/comments/254143.html</wfw:comment><comments>http://www.aygfsteel.com/pitey/archive/2009/02/10/254143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/pitey/comments/commentRss/254143.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/pitey/services/trackbacks/254143.html</trackback:ping><description><![CDATA[<p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"><span style="font-size: 10pt">Spring事物拦截器,按照通知方式分ؓ[前置通知QBefore adviceQ?q回后通知QAfter returning adviceQ?br /> ,抛出后通知QAfter throwing adviceQ?后通知QAfter (finally) adviceQ?环绕通知QAround AdviceQ]<br /> 配置方式分@AspectJ,XMLQ网上比较多的是Spring1.1或xml+@AspectJ方式配置Q例子用XML方式配置</span></span></span></span></p> <p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"><span style="font-size: 10pt">1.定义切面cL口,切面cd现这个接口。声明(如果被代理的目标对象实现了至一个接口,则会使用JDK动态代理。所有该目标cd实现的接口都被代理。若该目标对象没有实CQ何接口,则创Z个CGLIB代理Q?br /> </span></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_29_94_Open_Image" onclick="this.style.display='none'; Codehighlighter1_29_94_Open_Text.style.display='none'; Codehighlighter1_29_94_Closed_Image.style.display='inline'; Codehighlighter1_29_94_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_29_94_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_29_94_Closed_Text.style.display='none'; Codehighlighter1_29_94_Open_Image.style.display='inline'; Codehighlighter1_29_94_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">interface</span><span style="color: #000000"> ITestAdvice </span><span id="Codehighlighter1_29_94_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_29_94_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> doPlay();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> doStop(Object reval);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_136_295_Open_Image" onclick="this.style.display='none'; Codehighlighter1_136_295_Open_Text.style.display='none'; Codehighlighter1_136_295_Closed_Image.style.display='inline'; Codehighlighter1_136_295_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_136_295_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_136_295_Closed_Text.style.display='none'; Codehighlighter1_136_295_Open_Image.style.display='inline'; Codehighlighter1_136_295_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Tv </span><span style="color: #0000ff">implements</span><span style="color: #000000"> ITestAdvice</span><span id="Codehighlighter1_136_295_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_136_295_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_176_230_Open_Image" onclick="this.style.display='none'; Codehighlighter1_176_230_Open_Text.style.display='none'; Codehighlighter1_176_230_Closed_Image.style.display='inline'; Codehighlighter1_176_230_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_176_230_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_176_230_Closed_Text.style.display='none'; Codehighlighter1_176_230_Open_Image.style.display='inline'; Codehighlighter1_176_230_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> doStop(Object reval) </span><span id="Codehighlighter1_176_230_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_176_230_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(reval.toString() </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">关闭电视?</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_256_291_Open_Image" onclick="this.style.display='none'; Codehighlighter1_256_291_Open_Text.style.display='none'; Codehighlighter1_256_291_Closed_Image.style.display='inline'; Codehighlighter1_256_291_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_256_291_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_256_291_Closed_Text.style.display='none'; Codehighlighter1_256_291_Open_Image.style.display='inline'; Codehighlighter1_256_291_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> doPlay() </span><span id="Codehighlighter1_256_291_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_256_291_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">打开电视?</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"><span style="font-size: 10pt"> </span></span></span></span></p> <p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"><span style="font-size: 10pt">2.定义前置通知拦截处理c?/span></span></span></span></p> <p> </p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_37_119_Open_Image" onclick="this.style.display='none'; Codehighlighter1_37_119_Open_Text.style.display='none'; Codehighlighter1_37_119_Closed_Image.style.display='inline'; Codehighlighter1_37_119_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_37_119_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_37_119_Closed_Text.style.display='none'; Codehighlighter1_37_119_Open_Image.style.display='inline'; Codehighlighter1_37_119_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> TestMethodBeforeAdvice  </span><span id="Codehighlighter1_37_119_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_37_119_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_76_115_Open_Image" onclick="this.style.display='none'; Codehighlighter1_76_115_Open_Text.style.display='none'; Codehighlighter1_76_115_Closed_Image.style.display='inline'; Codehighlighter1_76_115_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_76_115_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_76_115_Closed_Text.style.display='none'; Codehighlighter1_76_115_Open_Image.style.display='inline'; Codehighlighter1_76_115_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> before(JoinPoint jpt) </span><span id="Codehighlighter1_76_115_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_76_115_Open_Text"><span style="color: #000000">{  //参数JoinPoint为默认参?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">正在打开电视..</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> <br /> <span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"><span style="font-size: 10pt">3.定义拦截器配|文?/span></span></span></span></p> <p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000"><</span><span style="color: #000000">bean id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">tv</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">com.pitey.demo.Tv</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #000000"><</span><span style="color: #000000">bean id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">beforeAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">com.pitey.demo.TestMethodBeforeAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:aspectj</span><span style="color: #000000">-</span><span style="color: #000000">autoproxy proxy</span><span style="color: #000000">-</span><span style="color: #000000">target</span><span style="color: #000000">-</span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">true</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><!--</span><span style="color: #000000"> 定义切入?#160;</span><span style="color: #000000">--></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><</span><span style="color: #000000">aop:pointcut id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">methodAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> expression</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">execution(* com.pitey.demo.*.*(..))</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><!--</span><span style="color: #000000"> 定义切面 </span><span style="color: #000000">--></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><</span><span style="color: #000000">aop:aspect id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">beforeAdviceAspect</span><span style="color: #000000">"</span><span style="color: #000000"> ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">beforeAdvice</span><span style="color: #000000">"</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />   </span><span style="color: #000000"><!--</span><span style="color: #000000"> 定义前置通知 </span><span style="color: #000000">--></span><span style="color: #000000">   <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />   </span><span style="color: #000000"><</span><span style="color: #000000">aop:before method</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">before</span><span style="color: #000000">"</span><span style="color: #000000"> pointcut</span><span style="color: #000000">-</span><span style="color: #000000">ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">methodAdvice</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000">    <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"></</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 4.试一下前|通知<br /> <span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_39_214_Open_Image" onclick="this.style.display='none'; Codehighlighter1_39_214_Open_Text.style.display='none'; Codehighlighter1_39_214_Closed_Image.style.display='inline'; Codehighlighter1_39_214_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_39_214_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_39_214_Closed_Text.style.display='none'; Codehighlighter1_39_214_Open_Image.style.display='inline'; Codehighlighter1_39_214_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span id="Codehighlighter1_39_214_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_39_214_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        ApplicationContext context </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ClassPathXmlApplicationContext(</span><span style="color: #000000">"</span><span style="color: #000000">config\\advice.xml</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Tv tv </span><span style="color: #000000">=</span><span style="color: #000000"> (Tv)context.getBean(</span><span style="color: #000000">"</span><span style="color: #000000">tv</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        tv.doPlay();        <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />l果:<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />            正在打开电视?img src="http://www.aygfsteel.com/Images/dot.gif" alt="" />..<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />            打开电视?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 5.定义q回后通知拦截处理c?/p> <p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_35_200_Open_Image" onclick="this.style.display='none'; Codehighlighter1_35_200_Open_Text.style.display='none'; Codehighlighter1_35_200_Closed_Image.style.display='inline'; Codehighlighter1_35_200_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_35_200_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_35_200_Closed_Text.style.display='none'; Codehighlighter1_35_200_Open_Image.style.display='inline'; Codehighlighter1_35_200_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> TestAfterReturnAdvice </span><span id="Codehighlighter1_35_200_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_35_200_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_99_196_Open_Image" onclick="this.style.display='none'; Codehighlighter1_99_196_Open_Text.style.display='none'; Codehighlighter1_99_196_Closed_Image.style.display='inline'; Codehighlighter1_99_196_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_99_196_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_99_196_Closed_Text.style.display='none'; Codehighlighter1_99_196_Open_Image.style.display='inline'; Codehighlighter1_99_196_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> afterReturning(Object retVal) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> Throwable </span><span id="Codehighlighter1_99_196_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_99_196_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  String returnVal </span><span style="color: #000000">=</span><span style="color: #000000"> 电视机已l打开</span><span style="color: #000000">!</span><span style="color: #000000">"</span><span style="color: #000000">;</span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">  System.out.println(returnVal);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  retVal</span><span style="color: #000000">=</span><span style="color: #000000"> (Object)returnVal;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 6.定义拦截器配|文?/p> <p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"><span style="font-size: 10pt"> </span></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000"><</span><span style="color: #000000">bean id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">afterReturnAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">com.pitey.demo.TestAfterReturnAdvice</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><!--</span><span style="color: #000000"> 定义切面 </span><span style="color: #000000">--></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><</span><span style="color: #000000">aop:aspect id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">afterReturnAdviceAspect</span><span style="color: #000000">"</span><span style="color: #000000"> ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">afterReturnAdvice</span><span style="color: #000000">"</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />   </span><span style="color: #000000"><!--</span><span style="color: #000000"> 定义后置q回通知  </span><span style="color: #000000">--></span><span style="color: #000000">   <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />   </span><span style="color: #000000"><</span><span style="color: #000000">aop:after</span><span style="color: #000000">-</span><span style="color: #000000">returning method</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">afterReturning</span><span style="color: #000000">"</span><span style="color: #000000"> pointcut</span><span style="color: #000000">-</span><span style="color: #000000">ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">methodAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> returning</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">retVal</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"> </span><span style="color: #008000">//</span><span style="color: #008000">returing 回参?/span><span style="color: #008000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #000000"> </span><span style="color: #000000"></</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 7.试一下返回后通知<br /> <span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"><span style="font-size: 10pt"><br /> </span></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_39_214_Open_Image" onclick="this.style.display='none'; Codehighlighter1_39_214_Open_Text.style.display='none'; Codehighlighter1_39_214_Closed_Image.style.display='inline'; Codehighlighter1_39_214_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_39_214_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_39_214_Closed_Text.style.display='none'; Codehighlighter1_39_214_Open_Image.style.display='inline'; Codehighlighter1_39_214_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span id="Codehighlighter1_39_214_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_39_214_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        ApplicationContext context </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ClassPathXmlApplicationContext(</span><span style="color: #000000">"</span><span style="color: #000000">config\\advice.xml</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Tv tv </span><span style="color: #000000">=</span><span style="color: #000000"> (Tv)context.getBean(</span><span style="color: #000000">"</span><span style="color: #000000">tv</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        tv.doPlay();        <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />l果:<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />            正在打开电视?img src="http://www.aygfsteel.com/Images/dot.gif" alt="" />..<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />            打开电视?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />            电视机已l打开</span><span style="color: #000000">!</span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 8.定义环绕通知拦截处理c(环绕通知在一个方法执行之前和之后执行?它得通知有机会既在一个方法执行之前又在执行之后运行。ƈ且,它可以决定这个方法在什么时候执行,如何执行Q甚x否执行?环绕通知l常在在某线E安全的环境下,你需要在一个方法执行之前和之后׃n某种状态的时候用?请尽量用最单的满你需求的通知。(比如如果前置通知Qbefore adviceQ也可以适用的情况下不要使用环绕通知Q)<br /> 通知Ҏ的第一个参数的cd必须?<code class="interfacename">ProceedingJoinPoint</code> cd。在通知的主体中Q调?<code class="interfacename">ProceedingJoinPoint</code>?code class="literal">proceed()</code> Ҏ来执行真正的Ҏ?<code class="literal">proceed</code> Ҏ也可能会被调用ƈ且传入一?<code class="classname">Object[]</code> 对象 - 该数l将作ؓҎ执行时候的参数?/p> <p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_33_245_Open_Image" onclick="this.style.display='none'; Codehighlighter1_33_245_Open_Text.style.display='none'; Codehighlighter1_33_245_Closed_Image.style.display='inline'; Codehighlighter1_33_245_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_33_245_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_33_245_Closed_Text.style.display='none'; Codehighlighter1_33_245_Open_Image.style.display='inline'; Codehighlighter1_33_245_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> TestMethodIntercepor</span><span id="Codehighlighter1_33_245_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_33_245_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_112_242_Open_Image" onclick="this.style.display='none'; Codehighlighter1_112_242_Open_Text.style.display='none'; Codehighlighter1_112_242_Closed_Image.style.display='inline'; Codehighlighter1_112_242_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_112_242_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_112_242_Closed_Text.style.display='none'; Codehighlighter1_112_242_Open_Image.style.display='inline'; Codehighlighter1_112_242_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> Object doBasicProfiling(ProceedingJoinPoint  pjp) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> Throwable </span><span id="Codehighlighter1_112_242_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_112_242_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">begining<img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  Object obj </span><span style="color: #000000">=</span><span style="color: #000000"> pjp.proceed();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">ending<img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" />..</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  </span><span style="color: #0000ff">return</span><span style="color: #000000"> obj;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> <br /> 9.定义拦截器配|文?/p> <p><span style="font-size: 10pt"><span style="font-family: 宋体"><span style="font-size: 12pt"><span style="font-size: 10pt"> </span></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000"><</span><span style="color: #000000">bean id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">aroundAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">com.pitey.demo.TestMethodIntercepor</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><!--</span><span style="color: #000000"> 定义切面 </span><span style="color: #000000">--></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><</span><span style="color: #000000">aop:aspect id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">aroundAspect</span><span style="color: #000000">"</span><span style="color: #000000"> ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">aroundAdvice</span><span style="color: #000000">"</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:around method</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">doBasicProfiling</span><span style="color: #000000">"</span><span style="color: #000000"> pointcut</span><span style="color: #000000">-</span><span style="color: #000000">ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">methodBeforeAdvice</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"></</span><span style="color: #000000">aop:aspect</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"></</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> <br /> 10.试一下环l通知<br /> </p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_39_214_Open_Image" onclick="this.style.display='none'; Codehighlighter1_39_214_Open_Text.style.display='none'; Codehighlighter1_39_214_Closed_Image.style.display='inline'; Codehighlighter1_39_214_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_39_214_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_39_214_Closed_Text.style.display='none'; Codehighlighter1_39_214_Open_Image.style.display='inline'; Codehighlighter1_39_214_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span id="Codehighlighter1_39_214_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_39_214_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        ApplicationContext context </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ClassPathXmlApplicationContext(</span><span style="color: #000000">"</span><span style="color: #000000">config\\advice.xml</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Tv tv </span><span style="color: #000000">=</span><span style="color: #000000"> (Tv)context.getBean(</span><span style="color: #000000">"</span><span style="color: #000000">tv</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        tv.doPlay();        <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />l果:<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />            begining<img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />            打开电视?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />            ending<img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" />..<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <img src ="http://www.aygfsteel.com/pitey/aggbug/254143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/pitey/" target="_blank">Pitey</a> 2009-02-10 23:07 <a href="http://www.aygfsteel.com/pitey/archive/2009/02/10/254143.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>?重写window.setTimeout传参?支持传对?的方?/title><link>http://www.aygfsteel.com/pitey/archive/2008/03/18/186930.html</link><dc:creator>Pitey</dc:creator><author>Pitey</author><pubDate>Tue, 18 Mar 2008 02:21:00 GMT</pubDate><guid>http://www.aygfsteel.com/pitey/archive/2008/03/18/186930.html</guid><wfw:comment>http://www.aygfsteel.com/pitey/comments/186930.html</wfw:comment><comments>http://www.aygfsteel.com/pitey/archive/2008/03/18/186930.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/pitey/comments/commentRss/186930.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/pitey/services/trackbacks/186930.html</trackback:ping><description><![CDATA[<p><font face="Tahoma">也许你过dsetTimeout中传参数一直是q样</font></p> <p><font face="Tahoma">setTimeout("pass(" + argu + ")",1000)</font></p> <p><font face="Tahoma">q样只能传字W串,对传递object无能ؓ力了,需要大Ҏ?然而别忘了,W一个参数还可以是function!!!</font></p> <p><font face="Tahoma">看以下代码实现向里面的function 传参?/font></p> <div style="border-left-color: #cccccc; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; background-color: #eeeeee; font-size: 13px; width: 98%; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #000000;"><</span><span style="color: #000000;">script type</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">text/javascript</span><span style="color: #000000;">"</span><span style="color: #000000;">><br /> </span><span style="color: #000000;">var _st </span><span style="color: #000000;">=</span><span style="color: #000000;"> window.setTimeout;window.setTimeout </span><span style="color: #000000;">=</span><span style="color: #000000;"> function(fRef, mDelay) {<br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(typeof fRef </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #000000;">'</span><span style="color: #000000;">function</span><span style="color: #000000;">'</span><span style="color: #000000;">){  <br />   var argu </span><span style="color: #000000;">=</span><span style="color: #000000;"> Array.prototype.slice.call(arguments,</span><span style="color: #000000;">2</span><span style="color: #000000;">);  <br />   var f </span><span style="color: #000000;">=</span><span style="color: #000000;"> (function(){ fRef.apply(</span><span style="color: #0000ff;">null</span><span style="color: #000000;">, argu); });  <br /> </span><span style="color: #0000ff;">  return</span><span style="color: #000000;"> _st(f, mDelay); } </span><span style="color: #0000ff;"><br />   return</span><span style="color: #000000;"> _st(fRef,mDelay);}<br /> <br /> function test(x){ alert(x);}<br /> window.setTimeout(test,</span><span style="color: #000000;">1000</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">fason</span><span style="color: #000000;">'</span><span style="color: #000000;">);</span><span style="color: #000000;"><br /> </</span><span style="color: #000000;">script</span><span style="color: #000000;">></span><span style="color: #000000;"><br /> </span></div> <font face="Tahoma"> <p><font face="Tahoma">怎样?是不是很方便?代码其实很?重蝲了一下window.setTimeout,用applyd调前面的function.</font></p> </font> <p><font face="Tahoma">q没有用qapply,call的可以去查资?发现版本不够的看我低版本的实现方?a target="_blank"><font color="#006400">http://blog.csdn.net/fason/archive/2004/07/30/apply_call.aspx</font></a></font></p> <p><font face="Tahoma">另外需要知道的?NS环境?后面的参数确实是来传l前面的函数?IE?没有实现~~~~~~~~~~~~~</font></p> <img src ="http://www.aygfsteel.com/pitey/aggbug/186930.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/pitey/" target="_blank">Pitey</a> 2008-03-18 10:21 <a href="http://www.aygfsteel.com/pitey/archive/2008/03/18/186930.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转document.execCommand()用法说明http://www.aygfsteel.com/pitey/archive/2008/03/17/186862.htmlPiteyPiteyMon, 17 Mar 2008 13:18:00 GMThttp://www.aygfsteel.com/pitey/archive/2008/03/17/186862.htmlhttp://www.aygfsteel.com/pitey/comments/186862.htmlhttp://www.aygfsteel.com/pitey/archive/2008/03/17/186862.html#Feedback0http://www.aygfsteel.com/pitey/comments/commentRss/186862.htmlhttp://www.aygfsteel.com/pitey/services/trackbacks/186862.htmldocument.execCommand()用法说明

2D
-Position 允许通过拖曳Udl对定位的对象?br /> AbsolutePosition 讑֮元素?#160;position 属性ؓ“absolute”(l对)?br /> BackColor 讄或获取当前选中区的背景颜色?br /> BlockDirLTR 目前未支持?br /> BlockDirRTL 目前未支持?br /> Bold 切换当前选中区的_体昄与否?br /> BrowseMode 目前未支持?br /> Copy 当前选中区复制到剪脓ѝ?br /> CreateBookmark 创徏一个书{N或获取当前选中区或插入点的书签锚的名称?br /> CreateLink 在当前选中Z插入链接Q或昄一个对话框允许用户指定要ؓ当前选中区插入的链接?#160;URL?br /> Cut 当前选中区复制到剪脓板ƈ删除之?br /> Delete 删除当前选中区?br /> DirLTR 目前未支持?br /> DirRTL 目前未支持?br /> EditMode 目前未支持?br /> FontName 讄或获取当前选中区的字体?br /> FontSize 讄或获取当前选中区的字体大小?br /> ForeColor 讄或获取当前选中区的前景(文本)颜色?br /> FormatBlock 讄当前块格式化标签?br /> Indent 增加选中文本的羃q?br /> InlineDirLTR 目前未支持?br /> InlineDirRTL 目前未支持?br /> InsertButton 用按钮控件覆盖当前选中区?br /> InsertFieldset 用方框覆盖当前选中区?br /> InsertHorizontalRule 用水q线覆盖当前选中区?br /> InsertIFrame 用内嵌框架覆盖当前选中区?br /> InsertImage 用图像覆盖当前选中区?br /> InsertInputButton 用按钮控件覆盖当前选中区?br /> InsertInputCheckbox 用复选框控g覆盖当前选中区?br /> InsertInputFileUpload 用文件上载控件覆盖当前选中区?br /> InsertInputHidden 插入隐藏控g覆盖当前选中区?br /> InsertInputImage 用图像控件覆盖当前选中区?br /> InsertInputPassword 用密码控件覆盖当前选中区?br /> InsertInputRadio 用单选钮控g覆盖当前选中区?br /> InsertInputReset 用重|控件覆盖当前选中区?br /> InsertInputSubmit 用提交控件覆盖当前选中区?br /> InsertInputText 用文本控件覆盖当前选中区?br /> InsertMarquee 用空字幕覆盖当前选中区?br /> InsertOrderedList 切换当前选中区是~号列表q是常规格式化块?br /> InsertParagraph 用换行覆盖当前选中区?br /> InsertSelectDropdown 用下拉框控g覆盖当前选中区?br /> InsertSelectListbox 用列表框控g覆盖当前选中区?br /> InsertTextArea 用多行文本输入控件覆盖当前选中区?br /> InsertUnorderedList 切换当前选中区是目W号列表q是常规格式化块?br /> Italic 切换当前选中区斜体显CZ否?br /> JustifyCenter 当前选中区在所在格式化块置中?br /> JustifyFull 目前未支持?br /> JustifyLeft 当前选中区所在格式化块左寚w?br /> JustifyNone 目前未支持?br /> JustifyRight 当前选中区所在格式化块右寚w?br /> LiveResize q MSHTML ~辑器在~放或移动过E中持箋更新元素外观Q而不是只在移动或~放完成后更新?br /> MultipleSelection 允许当用h?#160;Shift ?#160;Ctrl 键时一ơ选中多于一个站点可选元素?br /> Open 打开?br /> Outdent 减少选中区所在格式化块的~进?br /> OverWrite 切换文本状态的插入和覆盖?br /> Paste 用剪贴板内容覆盖当前选中区?br /> PlayImage 目前未支持?br /> Print 打开打印对话框以便用户可以打印当前页?br /> Redo 重做?br /> Refresh h当前文档?br /> RemoveFormat 从当前选中Z删除格式化标{?br /> RemoveParaFormat 目前未支持?br /> SaveAs 当?#160;Web 面保存为文件?br /> SelectAll 选中整个文档?br /> SizeToControl 目前未支持?br /> SizeToControlHeight 目前未支持?br /> SizeToControlWidth 目前未支持?br /> Stop 停止?br /> StopImage 目前未支持?br /> StrikeThrough 目前未支持?br /> Subscript 目前未支持?br /> Superscript 目前未支持?br /> UnBookmark 从当前选中Z删除全部书签?br /> Underline 切换当前选中区的下划U显CZ否?br /> Undo 撤消?br /> Unlink 从当前选中Z删除全部链接?br /> Unselect 清除当前选中区的选中状态?br />
<HTML>

        
<HEAD>

            
<TITLE>JavaScript--execCommand指o?/span></TITLE>

            
<SCRIPT LANGUAGE="javascript">

<!--

/*

*该function执行copy指o

*/

function fn_doufucopy(){

edit.select();

document.execCommand(
'Copy');

}

/*

*该function执行paste指o

*/

function fn_doufupaste() {

tt.focus();

document.execCommand(
'paste');

}

/*

*该function用来创徏一个超链接

*/

function fn_creatlink()

{

     document.execCommand(
'CreateLink',true,'true');//弹出一个对话框输入URL

     
//document.execCommand('CreateLink',false,'http://www.51js.com');

}

/*

*该function用来选中的区块设为指定的背景?br />
*/

function fn_change_backcolor()

{

     document.execCommand(
'BackColor',true,'#FFbbDD');//true或false都可?/span>

}

/*

*该function用来选中的区块设为指定的前景?改变选中区块的字体大?改变字体,字体变粗变斜

*/

function fn_change_forecolor()

{

//指定前景?/span>

document.execCommand(
'ForeColor',false,'#BBDDCC');//true或false都可?br />
//指定背景?/span>

document.execCommand(
'FontSize',false,7);      //true或false都可?br />
//字体必须是系l支持的字体

document.execCommand(
'FontName',false,'标楷?/span>');      //true或false都可?br />
//字体变粗

document.execCommand(
'Bold');

//变斜?/span>

document.execCommand(
'Italic');

}

/*

*该function用来选中的区块加上不同的U条

*/

function fn_change_selection()

{

//选中的文字加下划U?/span>

document.execCommand(
'Underline');

//在选中的文字上划粗U?/span>

document.execCommand(
'StrikeThrough');

//选中的部分文字变l?/span>

document.execCommand(
'SuperScript');

//选中区块的下划线取消?/span>

document.execCommand(
'Underline');

}

/*

     *该function用来选中的区块排成不同的格式

     
*/

function fn_format()

{

//有序列排?/span>

document.execCommand(
'InsertOrderedList');

//实心无序列排?/span>

document.execCommand(
'InsertUnorderedList');

//I心无序列排?/span>

document.execCommand(
'Indent');

}

/*

*该function用来选中的区块剪下或是删除掉

*/

function fn_CutOrDel()

{

//删除选中的区?br />
//document.execCommand('Delete');

//剪下选中的区?/span>

document.execCommand(
'Cut');

}

/*

*该function用来选中的区块重设ؓ一个相应的物g

*/

function fn_InsObj()

{

/*

     ******************************************

     * 以下指o都是为选中的区块重设一个object;

     * 如没有特D说?W二个参数true或false是一L;

     * 参数三表CZؓ该object的id;

     * 可以用在javascript中通过其指定的id来控制它

     ******************************************

*/

/*重设Z个button(InsertButton和InsertInputButtong一?

只不前者是button,后者是input)
*/

/*document.execCommand('InsertButton',false,"aa"); //true或false无效

document.all.aa.value="风舞九天";
*/

//重设Z个fieldset

/*document.execCommand('InsertFieldSet',true,"aa");

document.all.aa.innerText="刀剑如?;
*/

//插入一个水q线

//document.execCommand('InsertHorizontalRule',true,"aa");

//插入一个iframe

//document.execCommand('InsertIFrame',true,"aa");

//插入一个InsertImage,设ؓtrue旉要图?false时不需囄

//document.execCommand('InsertImage',false,"aa");

//插入一个checkbox

//document.execCommand('InsertInputCheckbox',true,"aa");

//插入一个filecd的object

//document.execCommand('InsertInputFileUpload',false,"aa");

//插入一个hidden

/*document.execCommand('InsertInputHidden',false,"aa");

alert(document.all.aa.id);
*/

//插入一个InputImage

/*document.execCommand('InsertInputImage',false,"aa");

document.all.aa.src="F-a10.gif";
*/

//插入一个Password

//document.execCommand('InsertInputPassword',true,"aa");

//插入一个Radio

//document.execCommand('InsertInputRadio',false,"aa");

//插入一个Reset

//document.execCommand('InsertInputReset',true,"aa");

//插入一个Submit

//document.execCommand('InsertInputSubmit',false,"aa");

//插入一个input text

//document.execCommand('InsertInputText',false,"aa");

//插入一个textarea

//document.execCommand('InsertTextArea',true,"aa");

//插入一?#160;select list box

//document.execCommand('InsertSelectListbox',false,"aa");

//插入一个single select

document.execCommand(
'InsertSelectDropdown',true,"aa");

//插入一个line break(回??)

//document.execCommand('InsertParagraph');

//插入一个marquee

/*document.execCommand('InsertMarquee',true,"aa");

document.all.aa.innerText="bbbbb";
*/

//用于取消选中的阴影部?br />
//document.execCommand('Unselect');

//选中面上的所有元?br />
//document.execCommand('SelectAll');

}

/*

*该function用来页面保存ؓ一个文?br />
*/

function fn_save()

{

//W二个参CؓƲ保存的文g?/span>

document.execCommand(
'SaveAs','mycodes.txt');

//打印整个面

//document.execCommand('print');

}

-->

            
</SCRIPT>

        
</HEAD>

        
<body>

            
<input id="edit" value="范例" NAME="edit"><br>

            
<button onclick="fn_doufucopy()" ID="Button1">Copy</button> <button onclick="fn_doufupaste()" ID="Button2">

                 paste
</button><br>

            
<textarea id="tt" rows="10" cols="50" NAME="tt"></textarea>

            
<hr>

            
<br>

            沉聚散变化又再,但是d卷土重来.
<br>

            天若有情天亦?人间正道是?
<br>

            都怪我,太执着,却也{不到花开叶落.
<br>

            
<br>

            Please select above letters, then click following buttons:
<br>

            
<hr>

            
<input type="button" value="创徏CreateLink" onclick="fn_creatlink()" ID="Button3" NAME="Button3"><br>

            
<input type="button" value="改变文字背景?/span>" onclick="fn_change_backcolor()" ID="Button4" NAME="Button4"><br>

            
<input type="button" value="改变文字前景?/span>" onclick="fn_change_forecolor()" ID="Button5" NAME="Button5"><br>

            
<input type="button" value="l文字加U条" onclick="fn_change_selection()" ID="Button6" NAME="Button6"><br>

            
<input type="button" value="改变文字的排?/span>" onclick="fn_format()" ID="Button7" NAME="Button7"><br>

            
<input type="button" value="删除或剪下选中的部?/span>" onclick="fn_CutOrDel()" ID="Button8" NAME="Button8"><br>

            
<input type="button" value="插入Object" onclick="fn_InsObj()" ID="Button9" NAME="Button9"><br>

            
<input type="button" value="保存或打印文?/span>" onclick="fn_save()" ID="Button10" NAME="Button10"><br>

            
<input type="button" value="试Refresh属?/span>" onclick="document.execCommand('Refresh')" ID="Button11"

                 NAME
="Button11">

        
</body>

</HTML>

普通的方式是激zM?/span><iframe>q入~辑状态,命o如下

IframeNamer.document.designMode
="On"

字体
--宋体、黑体、楷体等

execCommand(
"fontname","",字体)

字号
--字号大小

execCommand(
"fontsize","",字号)

加重

execCommand(
"Bold")

斜体

execCommand(
"Italic")

下划U?br />
execCommand(
"Underline")

删除U?br />
execCommand(
"StrikeThrough")

上标

execCommand(
"SuperScript")

下标

execCommand(
"SubScript")

有序排列
--数字序号

execCommand(
"InsertOrderedList")

无序排列
--圆点序号

execCommand(
"InsertUnorderedList")

向前~进

execCommand(
"Outdent")

向后~进

execCommand(
"Indent")

居左

execCommand(
"JustifyLeft")

居右

execCommand(
"JustifyRight")

居中

execCommand(
"JustifyCenter")

剪切

execCommand(
"Cut")



execCommand(
"Copy")

_脓

execCommand(
"Paste")

覆盖

execCommand(
"Overwrite")

取消操作
--IE5.0以后可以无限取消

execCommand(
"Undo")

重复操作

execCommand(
"Redo")

讄链接
--若按以下写法Q在IE5.0版本中会ȀzM个内建窗口,可以完成输入链接的功能,而且q可以选择MAILTO、FTP{各U链接类型,比较方便

execCommand(
"CreateLink")

在IE4.0中,没有内徏链接输入H口Q所以就需要用以下方式嵌入链接

execCommand(
"CreateLink","",TURL)

插入囄
--׃IE中嵌入的可编控g是针Ҏ地资源的Q所以其默认的图片资源来自本圎ͼ所以基于WEB内容的编辑最好自己做输入框,然后用如下命令实现?br />
execCommand(
"InsertImage","",ImgURL)

字体颜色

execCommand(
"ForeColor","",CColor)


Pitey 2008-03-17 21:18 发表评论
]]>
获取 Iframe内的元素对象http://www.aygfsteel.com/pitey/archive/2008/03/09/184830.htmlPiteyPiteySun, 09 Mar 2008 05:48:00 GMThttp://www.aygfsteel.com/pitey/archive/2008/03/09/184830.htmlhttp://www.aygfsteel.com/pitey/comments/184830.htmlhttp://www.aygfsteel.com/pitey/archive/2008/03/09/184830.html#Feedback2http://www.aygfsteel.com/pitey/comments/commentRss/184830.htmlhttp://www.aygfsteel.com/pitey/services/trackbacks/184830.html  获得ifream的对象,q把ifreame中页?lt;div id="my">隐藏?br />
test1.html

<html>
<head>
<script>
function t(){
var dd = document.all('test2').contentWindow.document;
dd.getElementById('my').style.display='none';

}
</script>
</head>
<body >
<input type="button" value="test" onClick="t();"/>
<iframe id="test2" name="test2" src="test2.html"></iframe>
</body>
</html>

test2.html
<html>
<head>
</head>
<body>
    
    
<div id="my" name="my">
       试一下,父窗体可以把我隐藏掉!!!!!!!!
  
</div>
</body>
</html>





Pitey 2008-03-09 13:48 发表评论
]]>
Spring 获取Connectionhttp://www.aygfsteel.com/pitey/archive/2008/03/05/183932.htmlPiteyPiteyWed, 05 Mar 2008 04:45:00 GMThttp://www.aygfsteel.com/pitey/archive/2008/03/05/183932.htmlhttp://www.aygfsteel.com/pitey/comments/183932.htmlhttp://www.aygfsteel.com/pitey/archive/2008/03/05/183932.html#Feedback1http://www.aygfsteel.com/pitey/comments/commentRss/183932.htmlhttp://www.aygfsteel.com/pitey/services/trackbacks/183932.htmlapplicationContext.xml里面讄

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="default" autowire="default" dependency-check="default">
        <property name="jndiName">
            <value>JDBC/TEST</value>           
        </property>
</bean> 或?br />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
        <property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:ora"></property>
        <property name="username" value="test"></property>
        <property name="password" value="123456"></property>
    </bean>


通过
DataSourceUtils.getConnection(DataSourceQ?p获取到设|的DataSource 然后获得connection

public static Connection getConnection()
            
throws SQLException
    {        
        
return DataSourceUtils.getConnection((DataSource)ServiceLocator.getBean("dataSource"));
}



Pitey 2008-03-05 12:45 发表评论
]]>
模式H体关闭后调用父cȝ体的Ҏhttp://www.aygfsteel.com/pitey/archive/2007/05/07/115728.htmlPiteyPiteyMon, 07 May 2007 09:04:00 GMThttp://www.aygfsteel.com/pitey/archive/2007/05/07/115728.htmlhttp://www.aygfsteel.com/pitey/comments/115728.htmlhttp://www.aygfsteel.com/pitey/archive/2007/05/07/115728.html#Feedback0http://www.aygfsteel.com/pitey/comments/commentRss/115728.htmlhttp://www.aygfsteel.com/pitey/services/trackbacks/115728.html 调用模式H体window.showModalDialog('/test.html',window)   记得W二个参C定要把父cȝ体当参数传到模式H体?br />
模式H体加入事g
<script for="window" event="onunload">
    dialogArguments.window.test();  
</script>
q样可以在模式H体关闭或者是重蝲的时候调用父cȝ体的ҎQ如果不惌重蝲的时候调用父H体的test()ҎQ可以给父窗体传一个变量,到时候根据变量的值来判断是不是要执行test()Ҏ?br />




Pitey 2007-05-07 17:04 发表评论
]]>
վ֩ģ壺 | ʡ| | | | | ¡| | Ҧ| | ɽ| ƽ| ʯ| | ӯ| | | ԭ| ɽ| | | | ͭ| | | ʡ| | | | ¹| | ƽ| | ͨɽ| | | ¦| | | ͬ| |