??xml version="1.0" encoding="utf-8" standalone="yes"?>精品无码专区亚洲,亚洲av最新在线观看网址,亚洲色偷偷偷鲁综合http://m.tkk7.com/jaunt/category/17630.html站在巨h的肩?lt;br> Flying in the world of Javazh-cnFri, 24 Aug 2007 12:54:14 GMTFri, 24 Aug 2007 12:54:14 GMT60spring中的jpetstore安装http://m.tkk7.com/jaunt/archive/2007/08/24/139085.htmlJauntJauntFri, 24 Aug 2007 05:20:00 GMThttp://m.tkk7.com/jaunt/archive/2007/08/24/139085.htmlhttp://m.tkk7.com/jaunt/comments/139085.htmlhttp://m.tkk7.com/jaunt/archive/2007/08/24/139085.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/139085.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/139085.html最q用spring做了一点东?感觉对spring有个大概的了?对IOC比较熟悉?不过对于AOPq是挺陌生的.在网上一直听说spring自带的jpetstore比较l典,所以想down下来看看源码..

安装q程其实比较easy?不过刚开始弄了半天都没有搞出?l果到后来只用几分钟搞定了,看来有时候静下来一个h思考一下还是比较重要的.

下面单的说一下我以Sqlserver为数据库的安装过E?

首先到http://sourceforge.net/project/showfiles.php?group_id=73357&package_id=173644上去下蝲spring的新版本,我刚开始安装的时候是用的旧版本的jpetstore,
l果它的lib中的应该有的好多包都没有,q得自己d?g好就会好多错误的, 我的好多旉都浪费到q个上了,而且旧版本启动spring容器只能?br>
Servlet org.springframework.web.context.ContextLoaderServletq个servlet来启动的,它用不了容器监听器的.当时个也挺郁L.另外jpetstore有两U模式的,
一U是Zstruts?一U是Zspring.,至于你启动那U模?只需要在web.xml改一下就行了.

W一:

下蝲完毕后到samples文g夹中扑ֈjpetstore.在其中运行warfile.bat.q行后它会自动生成一个dist文g?把这个文件夹中的jpetstore.war拷到tomcat下的webapps?
q行tomcat,它会自动生成一个jpetstore文g.然后拿samples\jpetstore\db\hsqldb中的两个sql脚本到Sqlserver的查询分析器中去执行,q是建立?q对表进行了插?
当然之前你要Z个名为jpetstore的数据库.

W二:改一下web-inf下的jdbc.property配置文g,如果用sqlserver的话,Ҏ以下的配|就?br>
   jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver

jdbc.url=jdbc:jtds:sqlserver://localhost:1433;DatabaseName=jpetstore

jdbc.username=sa

jdbc.password=sa

我用的是jtds驱动,所以你q得把这个jar包放到lib文g夹中,否则会报错的.

 

然后启动tomcat,用http://localhost:8080/jpetstore/应该可以讉K?

 


Jaunt 2007-08-24 13:20 发表评论
]]>
split()Ҏhttp://m.tkk7.com/jaunt/archive/2007/08/24/139076.htmlJauntJauntFri, 24 Aug 2007 04:44:00 GMThttp://m.tkk7.com/jaunt/archive/2007/08/24/139076.htmlhttp://m.tkk7.com/jaunt/comments/139076.htmlhttp://m.tkk7.com/jaunt/archive/2007/08/24/139076.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/139076.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/139076.html 在java.lang包中有String.split()ҎQ返回是一个数l?br>我在应用中用C些,l大家ȝ一下,仅供大家参考:
1、如果用“.”作ؓ分隔的话Q必L如下写法QString.split("\\."),q样才能正确的分隔开Q不能用String.split(".");
2、如果用“|”作ؓ分隔的话Q必L如下写法QString.split("\\|"),q样才能正确的分隔开Q不能用String.split("|");
“.”?#8220;|”都是转义字符Q必d?\\";
3、如果在一个字W串中有多个分隔W,可以?#8220;|”作ؓq字W,比如Q?#8220;acount=? and uu =? or n=?”,把三个都分隔出来Q可以用String.split("and|or");


/*
 *取文件中?. 的后辍名
 *
package com.test;

public class Test {

    /**
     * @param args
     */
    public static void main(String[] args)
    {
        String str = "pp.liv.picture.jpg";
        
        String[] arr = str.split("\\.");
        System.out.println(arr[arr.length-1]);
    }

}


Jaunt 2007-08-24 12:44 发表评论
]]>
jdk1.5新特?/title><link>http://m.tkk7.com/jaunt/archive/2007/08/24/139004.html</link><dc:creator>Jaunt</dc:creator><author>Jaunt</author><pubDate>Fri, 24 Aug 2007 01:25:00 GMT</pubDate><guid>http://m.tkk7.com/jaunt/archive/2007/08/24/139004.html</guid><wfw:comment>http://m.tkk7.com/jaunt/comments/139004.html</wfw:comment><comments>http://m.tkk7.com/jaunt/archive/2007/08/24/139004.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jaunt/comments/commentRss/139004.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jaunt/services/trackbacks/139004.html</trackback:ping><description><![CDATA[<p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 12.9pt;" align="left"><span style="font-size: 9.5pt; font-family: 宋体; color: black;">  </span><strong><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US">1.</span></strong><strong><span style="font-size: 9.5pt; font-family: 宋体; color: black;">泛型</span></strong><strong><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US">(Generic)</span></strong><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><br> <br> </span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">  </span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US">C++</span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">通过模板技术可以指定集合的元素cdQ?/span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US">Java</span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">?/span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US">1.5</span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">之前一直没有相对应的功能。一个集合可以放Mcd的对象,相应C集合里面拿对象的时候我们也不得不对他们q行强制得类型{换。猛虎引入了泛型Q它允许指定集合里元素的cdQ这样你可以得到强类型在~译时刻q行cd查的好处?/span><span style="font-size: 9.5pt; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 12.9pt;" align="left"><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">Collection<String></span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">c</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">=</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">new</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">ArrayList();<br> c.add(new</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">Date());<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 12.9pt;" align="left"><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">  ~译器会l出一个错误:</span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 12.9pt;" align="left"><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">add(java.lang.String)</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">in</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">java.util.Collection<java.lang.String></span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">cannot</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">be</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">applied</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">to</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">(java.util.Date)<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 12.9pt;" align="left"><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">  </span><strong><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US">2.For-Each</span></strong><strong><span style="font-size: 9.5pt; font-family: 宋体; color: black;">循环</span></strong><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><br> <br> </span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">  </span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US">For-Each</span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">循环得加入简化了集合的遍历。假设我们要遍历一个集合对其中的元素进行一些处理。典型的代码为:</span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 12.9pt;" align="left"><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">void</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">processAll(Collection</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">c){<br> </span><span style="font-size: 8pt; font-family: 宋体; color: black;">    </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">for(Iterator</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">i=c.iterator();</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">i.hasNext();){<br> </span><span style="font-size: 8pt; font-family: 宋体; color: black;">        </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">MyClass</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">myObject</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">=</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">(MyClass)i.next();<br> </span><span style="font-size: 8pt; font-family: 宋体; color: black;">        </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">myObject.process();<br> </span><span style="font-size: 8pt; font-family: 宋体; color: black;">    </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">}<br> }<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 12.9pt;" align="left"><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">  使用</span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US">For-Each</span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">循环Q我们可以把代码改写成:</span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 12.9pt;" align="left"><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">void</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">processAll(Collection<MyClass></span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">c){<br> </span><span style="font-size: 8pt; font-family: 宋体; color: black;">    </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">for</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">(MyClass</span><span style="font-size: 8pt; font-family: 宋体; color: black;">  </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">myObject</span><span style="font-size: 8pt; font-family: 宋体; color: black;"> </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">:c)<br> </span><span style="font-size: 8pt; font-family: 宋体; color: black;">        </span><span style="font-size: 8pt; font-family: arial; color: black;" lang="EN-US">myObject.process();<br> }<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal"><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-size: 9.5pt; font-family: 宋体; color: black;">  q段代码要比上面清晰许多Qƈ且避免了强制cd转换?/span><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <p class="MsoNormal"><span style="font-size: 9.5pt; font-family: arial; color: black;" lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 14.25pt;" align="left"><span style="font-family: 宋体; color: black;"> </span><strong><span style="font-family: arial; color: black;" lang="EN-US">3.</span></strong><strong><span style="font-family: 宋体; color: black;">自动装包</span></strong><strong><span style="font-family: arial; color: black;" lang="EN-US">/</span></strong><strong><span style="font-family: 宋体; color: black;">拆包</span></strong><strong><span style="font-family: arial; color: black;" lang="EN-US">(Autoboxing/unboxing)</span></strong><span style="font-family: arial; color: black;" lang="EN-US"><br> <br> </span><span style="font-family: 宋体; color: black;">  自动装包</span><span style="font-family: arial; color: black;" lang="EN-US">/</span><span style="font-family: 宋体; color: black;">拆包大大方便了基本类型数据和它们包装cd使用?/span><span style="font-family: arial; color: black;" lang="EN-US"><br> <br> </span><span style="font-family: 宋体; color: black;">  自动装包Q基本类型自动{为包装类</span><span style="font-family: arial; color: black;" lang="EN-US">.(int</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">>></span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">Integer)<br> <br> </span><span style="font-family: 宋体; color: black;">  自动拆包Q包装类自动转ؓ基本cd</span><span style="font-family: arial; color: black;" lang="EN-US">.(Integer</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">>></span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">int)<br> <br> </span><span style="font-family: 宋体; color: black;">  ?/span><span style="font-family: arial; color: black;" lang="EN-US">JDK1.5</span><span style="font-family: 宋体; color: black;">之前Q我们L寚w合不能存攑֟本类型而耿耿于怀Q现在自动{换机制解决了我们的问题?/span><span style="font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 14.25pt;" align="left"><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">int</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">a</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">=</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">3;<br> Collection</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">c</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">=</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">new</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">ArrayList();<br> c.add(a);//</span><span style="font-size: 9pt; font-family: 宋体; color: black;">自动转换?/span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">Integer.<br> <br> Integer</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">b</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">=</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">new</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">Integer(2);<br> c.add(b</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">+</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">2);<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal" style="text-align: left; line-height: 14.25pt;" align="left"><span style="font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-family: 宋体; color: black;">  q里</span><span style="font-family: arial; color: black;" lang="EN-US">Integer</span><span style="font-family: 宋体; color: black;">先自动{换ؓ</span><span style="font-family: arial; color: black;" lang="EN-US">int</span><span style="font-family: 宋体; color: black;">q行加法q算Q然?/span><span style="font-family: arial; color: black;" lang="EN-US">int</span><span style="font-family: 宋体; color: black;">再次转换?/span><span style="font-family: arial; color: black;" lang="EN-US">Integer.<br> <br> </span><span style="font-family: 宋体; color: black;">  </span><strong><span style="font-family: arial; color: black;" lang="EN-US">4.</span></strong><strong><span style="font-family: 宋体; color: black;">枚D</span></strong><strong><span style="font-family: arial; color: black;" lang="EN-US">(Enums)</span></strong><span style="font-family: arial; color: black;" lang="EN-US"><br> <br> </span><span style="font-family: 宋体; color: black;">  </span><span style="font-family: arial; color: black;" lang="EN-US">JDK1.5</span><span style="font-family: 宋体; color: black;">加入了一个全新类型的</span><span style="font-family: arial; color: black;" lang="EN-US">“</span><span style="font-family: 宋体; color: black;">c?/span><span style="font-family: arial; color: black;" lang="EN-US">”</span><span style="font-family: 宋体; color: black;">Q枚丄型。ؓ?/span><span style="font-family: arial; color: black;" lang="EN-US">JDK1.5</span><span style="font-family: 宋体; color: black;">引入了一个新关键?/span><span style="font-family: arial; color: black;" lang="EN-US">enmu.</span><span style="font-family: 宋体; color: black;"> 我们可以q样来定义一个枚丄型?/span><span style="font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 14.25pt;" align="left"><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">public</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">enum</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">Color<br> {<br> </span><span style="font-size: 9pt; font-family: 宋体; color: black;">   </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">Red,<br> </span><span style="font-size: 9pt; font-family: 宋体; color: black;">   </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">White,<br> </span><span style="font-size: 9pt; font-family: 宋体; color: black;">   </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">Blue<br> }<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 14.25pt;" align="left"><span style="font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-family: 宋体; color: black;">  然后可以q样来?/span><span style="font-family: arial; color: black;" lang="EN-US">Color</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">myColor</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">=</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">Color.Red.<br> <br> </span><span style="font-family: 宋体; color: black;">  枚Dcdq提供了两个有用的静态方?/span><span style="font-family: arial; color: black;" lang="EN-US">values()</span><span style="font-family: 宋体; color: black;">?/span><span style="font-family: arial; color: black;" lang="EN-US">valueOf().</span><span style="font-family: 宋体; color: black;"> 我们可以很方便地使用它们Q例?/span><span style="font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 14.25pt;" align="left"><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">for</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">(Color</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">c</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">:</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">Color.values())<br> </span><span style="font-size: 9pt; font-family: 宋体; color: black;">            </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">System.out.println(c);<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 14.25pt;" align="left"><span style="font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-family: 宋体; color: black;">  </span><strong><span style="font-family: arial; color: black;" lang="EN-US">5.</span></strong><strong><span style="font-family: 宋体; color: black;">可变参数</span></strong><strong><span style="font-family: arial; color: black;" lang="EN-US">(Varargs)</span></strong><span style="font-family: arial; color: black;" lang="EN-US"><br> <br> </span><span style="font-family: 宋体; color: black;">  可变参数使程序员可以声明一个接受可变数目参数的Ҏ。注意,可变参数必须是函数声明中的最后一个参数。假设我们要写一个简单的Ҏ打印一些对象,</span><span style="font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 14.25pt;" align="left"><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">util.write(obj1);<br> util.write(obj1,obj2);<br> util.write(obj1,obj2,obj3);<br> …<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 14.25pt;" align="left"><span style="font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-family: 宋体; color: black;">  ?/span><span style="font-family: arial; color: black;" lang="EN-US">JDK1.5</span><span style="font-family: 宋体; color: black;">之前Q我们可以用重蝲来实玎ͼ但是q样需要写很多的重载函敎ͼ昑־不是很有效。如果用可变参数的话我们只需要一个函数就行了</span><span style="font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 14.25pt;" align="left"><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">public</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">void</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">write(Object...</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">objs)</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">{<br> </span><span style="font-size: 9pt; font-family: 宋体; color: black;">   </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">for</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">(Object</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">obj:</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">objs)<br> </span><span style="font-size: 9pt; font-family: 宋体; color: black;">      </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">System.out.println(obj);<br> }<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal" style="margin-bottom: 12pt; text-align: left; line-height: 14.25pt;" align="left"><span style="font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-family: 宋体; color: black;">  在引入可变参C后,</span><span style="font-family: arial; color: black;" lang="EN-US">Java</span><span style="font-family: 宋体; color: black;">的反包也更加方便用了。对?/span><span style="font-family: arial; color: black;" lang="EN-US">c.getMethod("test",</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">new</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">Object[0]).invoke(c.newInstance(),</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">new</span><span style="font-family: 宋体; color: black;"> </span><span style="font-family: arial; color: black;" lang="EN-US">Object[0]))</span><span style="font-family: 宋体; color: black;">Q现在我们可以这样写?/span><span style="font-family: arial; color: black;" lang="EN-US">c.getMethod("test").invoke(c.newInstance())</span><span style="font-family: 宋体; color: black;">Q这L代码比原来清楚了很多。 </span><span style="font-family: arial; color: black;" lang="EN-US"><br> <br> </span><span style="font-family: 宋体; color: black;">  </span><strong><span style="font-family: arial; color: black;" lang="EN-US">6.</span></strong><strong><span style="font-family: 宋体; color: black;">静态导?/span></strong><strong><span style="font-family: arial; color: black;" lang="EN-US">(Static</span></strong><strong><span style="font-family: 宋体; color: black;"> </span></strong><strong><span style="font-family: arial; color: black;" lang="EN-US">Imports)</span></strong><span style="font-family: arial; color: black;" lang="EN-US"><br> <br> </span><span style="font-family: 宋体; color: black;">  要用用静态成员(Ҏ和变量)我们必须l出提供q个Ҏ的类。用静态导入可以被导入类的所有静态变量和静态方法在当前cȝ接可见,使用q些静态成员无需再给Z们的cd?/span><span style="font-family: arial; color: black;" lang="EN-US"><o:p></o:p></span></p> <div align="center"> <table class="MsoNormalTable" style="background: #e6e4dd none repeat scroll 0% 50%; width: 90%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="0" width="90%"> <tbody> <tr> <td style="padding: 0.75pt;"> <p class="MsoNormal" style="text-align: left; line-height: 14.25pt;" align="left"><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">import</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">static</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">java.lang.Math.*;<br> …….<br> r</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">=</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">sin(PI</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">*</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">2);</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">//</span><span style="font-size: 9pt; font-family: 宋体; color: black;">无需再写</span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">r</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">=</span><span style="font-size: 9pt; font-family: 宋体; color: black;"> </span><span style="font-size: 9pt; font-family: arial; color: black;" lang="EN-US">Math.sin(Math.PI);<o:p></o:p></span></p> </td> </tr> </tbody> </table> </div> <p class="MsoNormal"><span style="font-family: arial; color: black;" lang="EN-US"><br> </span><span style="font-family: 宋体; color: black;">  不过Q过度用这个特性也会一定程度上降低代码地可L?/span></p><img src ="http://m.tkk7.com/jaunt/aggbug/139004.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jaunt/" target="_blank">Jaunt</a> 2007-08-24 09:25 <a href="http://m.tkk7.com/jaunt/archive/2007/08/24/139004.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>c:forEach标签的?/title><link>http://m.tkk7.com/jaunt/archive/2007/08/24/139002.html</link><dc:creator>Jaunt</dc:creator><author>Jaunt</author><pubDate>Fri, 24 Aug 2007 01:24:00 GMT</pubDate><guid>http://m.tkk7.com/jaunt/archive/2007/08/24/139002.html</guid><wfw:comment>http://m.tkk7.com/jaunt/comments/139002.html</wfw:comment><comments>http://m.tkk7.com/jaunt/archive/2007/08/24/139002.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jaunt/comments/commentRss/139002.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jaunt/services/trackbacks/139002.html</trackback:ping><description><![CDATA[<div> <strong><font size="2">c:forEach标签的?/font></strong><br> <br> 在JSP的开发中QP代是l常要用到的操作。例如,逐行的显C查询的l果{。在早期的JSP中,通常使用Scriptlets来实现Iterator?者Enumeration对象的P代输出。现在,通过JSTL的P代标{֏以在很大的程度上化P代操作?br> <br>            JSTL所支持的P代标{有两个Q分别是c:forEach和c:forTokens。在q里介绍的是c:forEach标签?br> <br>            单点_标签的作用就是P代输出标{ֆ部的内容。它既可以进行固定次数的q代输出Q也可以依据集合中对象的个数来决定P代的ơ数?br> <br>            c:forEach标签的语法定义如下所C?br> <br> <div id="emugmgo" class="code_title"> xml 代码 </div> <div id="sgwuqqa" class="dp-highlighter"> <ol class="dp-xml"> <li id="auqqkia" class="alt"> <span><span id="ucyqmsi" class="tag"><</span><span id="uwqcwkk" class="tag-name">c:forEach</span><span> </span><span id="sugyyqi" class="attribute">var</span><span>=</span><span id="scoycqk" class="attribute-value">"name"</span><span> </span><span id="ikwgkio" class="attribute">items</span><span>=</span><span id="cuwisio" class="attribute-value">"expression"</span><span> </span><span id="qsuoagg" class="attribute">varStatus</span><span>=</span><span id="acwakay" class="attribute-value">"name"</span><span>    </span></span> </li> <li id="gsmgigy" class=""> <span>  </span> </li> <li id="ysuwoec" class="alt"> <span>         </span><span id="aeysukk" class="attribute">begin</span><span>=</span><span id="ycgimua" class="attribute-value">"expression"</span><span> </span><span id="gqueyoe" class="attribute">end</span><span>=</span><span id="mgakuua" class="attribute-value">"expression"</span><span> </span><span id="eeicekc" class="attribute">step</span><span>=</span><span id="waswooe" class="attribute-value">"expression"</span><span id="mmwqciy" class="tag">></span><span>  </span> </li> <li id="suqiccs" class=""> <span>  </span> </li> <li id="mqkuygy" class="alt"> <span>         body content    </span> </li> <li id="ckoamsq" class=""> <span>  </span> </li> <li id="mwoimki" class="alt"> <span></span><span id="yyaeywm" class="tag"></</span><span id="weqkoeu" class="tag-name">c:forEach</span><span id="cmyaems" class="tag">></span><span>  </span> </li> </ol> </div> <br> <br>            标签h以下一些属性:<br> <br>            varQP代参数的名称。在q代体中可以使用的变量的名称Q用来表C每一个P代变量。类型ؓString?br> <br>            itemsQ要q行q代的集合。对于它所支持的类型将在下面进行讲解?br> <br>            varStatusQP代变量的名称Q用来表CP代的状态,可以讉K到P代自w的信息?br> <br>            beginQ如果指定了itemsQ那么P代就从items[begin]开始进行P代;如果没有指定itemsQ那么就从begin开始P代。它的类型ؓ整数?br> <br>            endQ如果指定了itemsQ那么就在items[end]l束q代Q如果没有指定itemsQ那么就在endl束q代。它的类型也为整数?br> <br>            stepQP代的步长?br> <br>            标签的items属性支持Javaq_所提供的所有标准集合类型。此外,您可以用该操作来P代数l(包括基本cd数组Q中的元素。它所支持的集合类型以及P代的元素如下所C:<br><br>            java.util.CollectionQ调用iterator()来获得的元素?br> <br>            java.util.MapQ通过java.util.Map.Entry所获得的实例?br> <br>            java.util.IteratorQP代器元素?br> <br>            java.util.EnumerationQ枚丑օ素?br> <br>            Object实例数组Q数l元素?br> <br>            基本cd值数l:l过包装的数l元素?br> <br>            用逗号定界的StringQ分割后的子字符丌Ӏ?br> <br>            javax.servlet.jsp.jstl.sql.ResultQSQL查询所获得的行?br> <br>            不论是对整数q是寚w合进行P代,的varStatus 属性所L作用相同。和var属性一PvarStatus用于创徏限定了作用域的变量(改变量只在当前标{体内v作用Q。不q,由varStatus? 性命名的变量q不存储当前索引值或当前元素Q而是赋予javax.servlet.jsp.jstl.core.LoopTagStatuscȝ实例。该 cd含了一pd的特性,它们描述了P代的当前状态,如下q些属性的含义如下所C:<br> <br>            currentQ当前这ơP代的Q集合中的)V?br> <br>            indexQ当前这ơP代从0开始的q代索引?br> <br>            countQ当前这ơP代从1开始的q代计数?br> <br>            firstQ用来表明当前这轮P代是否ؓW一ơP代,该属性ؓbooleancd?br> <br>            lastQ用来表明当前这轮P代是否ؓ最后一ơP代,该属性ؓbooleancd?br> <br>            beginQbegin属性的倹{?br> <br>            endQend属性的?br> <br>            stepQstep属性的?br> <br> 下面来看一个个基本的例子,表格隔行背景色变? </div> <div id="samgaaq" class="code_title"> xml 代码 </div> <ol class="dp-xml"> <li id="cmwskki" class="alt"> <span><span id="giumyww" class="tag"><</span><span id="auyamsa" class="tag-name">c:forEach</span><span> </span><span id="ceyswcs" class="attribute">var</span><span>=</span><span id="smyacua" class="attribute-value">"item"</span><span> </span><span id="giacomk" class="attribute">items</span><span>=</span><span id="ooymoau" class="attribute-value">"${contents}"</span><span> </span><span id="gyiugme" class="attribute">varStatus</span><span>=</span><span id="qsuoiqe" class="attribute-value">"status"</span><span id="gicmogu" class="tag">></span><span>  </span></span> </li> <li id="seokuus" class=""> <span>      </span><span id="wgcuoeu" class="tag"><</span><span id="mogsoek" class="tag-name">tr</span><span> </span><span id="qqkuooo" class="tag"><</span><span id="aceisaq" class="tag-name">c:if</span><span> </span><span id="uugimck" class="attribute">test</span><span>=</span><span id="keoicia" class="attribute-value">"${status.count%2==0}"</span><span id="ueyiksi" class="tag">></span><span id="emqcmui" class="attribute">bgcolor</span><span>=</span><span id="iacoiio" class="attribute-value">"#CCCCFE"</span><span id="mwgkecc" class="tag"></</span><span id="mgicmuu" class="tag-name">c:if</span><span id="eoskgee" class="tag">></span><span> </span><span id="qaoqksq" class="attribute">align</span><span>=</span><span id="qswyssq" class="attribute-value">"left"</span><span id="ceqsekc" class="tag">></span><span>  </span> </li> <li id="kmwysaq" class="alt"> <span>            xxx   </span> </li> <li id="eoiseec" class=""> <span>            </span><span id="ggceygm" class="tag"></</span><span id="wgykwmc" class="tag-name">tr</span><span id="cuqkeka" class="tag">></span><span>  </span> </li> <li id="gquwsqw" class="alt"> <span></span><span id="umgamkc" class="tag"></</span><span id="ekoykai" class="tag-name">c:forEach</span><span id="ueqswma" class="tag">></span> </li> </ol><img src ="http://m.tkk7.com/jaunt/aggbug/139002.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jaunt/" target="_blank">Jaunt</a> 2007-08-24 09:24 <a href="http://m.tkk7.com/jaunt/archive/2007/08/24/139002.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MyEclipse 快捷?/title><link>http://m.tkk7.com/jaunt/archive/2007/08/24/138999.html</link><dc:creator>Jaunt</dc:creator><author>Jaunt</author><pubDate>Fri, 24 Aug 2007 01:23:00 GMT</pubDate><guid>http://m.tkk7.com/jaunt/archive/2007/08/24/138999.html</guid><wfw:comment>http://m.tkk7.com/jaunt/comments/138999.html</wfw:comment><comments>http://m.tkk7.com/jaunt/archive/2007/08/24/138999.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jaunt/comments/commentRss/138999.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jaunt/services/trackbacks/138999.html</trackback:ping><description><![CDATA[<p><font face="Arial">MyEclipse 快捷?br> Q?QCtrl+M切换H口的大?br> Q?QCtrl+Q跛_最后一ơ的~辑?br> Q?QF2当鼠标放在一个标记处出现Tooltip时候按F2则把鼠标Ud时Tooltipq会昄即Show Tooltip Description?br>           F3跛_声明或定义的地方?br>           F5单步调试q入函数内部?br>           F6单步调试不进入函数内部,如果装了金山词霸2006则要?#8220;取词开?#8221;的快捷键Ҏ其他的?br>           F7由函数内部返回到调用处?br>           F8一直执行到下一个断炏V?br> Q?QCtrl+Pg~对于XML文g是切换代码和囄H口<br> Q?QCtrl+Alt+I看Java文g中变量的相关信息<br> Q?QCtrl+PgUp对于代码H口是打开“Show List”下拉框,在此下拉框里昄有最q曾打开的文?br> Q?QCtrl+/ 在代码窗口中是这U?/~注释?br>           Ctrl+Shift+/ 在代码窗口中是这U?*~*/注释Q在JSP文gH口中是<!--~-->?br> Q?QAlt+Shift+O(或点dh中的Toggle Mark Occurrences按钮) 当点L个标记时可本页面中其他地方的此标记黄色凸显Qƈ且窗口的双框会出现白色的方块,点击此方块会跛_此标记处?br> Q?Q右ȝ口的左边框即加断点的地方选Show Line Numbers可以加行受?br> Q?0QCtrl+I格式化激zȝ元素Format Active Elements?br>             Ctrl+Shift+F格式化文件Format Document?br> Q?1QCtrl+S保存当前文g?br>             Ctrl+Shift+S保存所有未保存的文件?br> Q?2QCtrl+Shift+M(先把光标攑֜需导入包的cd? 作用是加Import语句?br>             Ctrl+Shift+O作用是缺的Import语句被加入,多余的Import语句被删除?br> Q?3QCtrl+Space提示键入内容即Content AssistQ此时要输入法中Chinese(Simplified)IME-Ime/Nonlme Toggle的快捷键Q用于切换英文和其他文字Q改成其他的?br>             Ctrl+Shift+Space提示信息即Context Information?br> Q?4Q双ȝ口的左边框可以加断点?br> Q?5QCtrl+D删除当前行?/font></p> <font face="Arial"> <p><br> Q-Q待l?/p> <p><br> [以下{载]<br> Eclipse快捷键大?br> Ctrl+1 快速修?最l典的快捷键,׃用多说了)<br> Ctrl+D: 删除当前?<br> Ctrl+Alt+↓ 复制当前行到下一?复制增加)<br> Ctrl+Alt+↑ 复制当前行到上一?复制增加)</p> <p>Alt+↓ 当前行和下面一行交互位|?特别实用,可以省去先剪?再粘贴了)<br> Alt+↑ 当前行和上面一行交互位|?同上)<br> Alt+← 前一个编辑的面<br> Alt+→ 下一个编辑的面(当然是针对上面那条来说了)</p> <p>Alt+Enter 昄当前选择资源(工程,or 文g or文g)的属?/p> <p>Shift+Enter 在当前行的下一行插入空?q时鼠标可以在当前行的Q一位置,不一定是最?<br> Shift+Ctrl+Enter 在当前行插入I(原理同上?</p> <p>Ctrl+Q 定位到最后编辑的地方<br> Ctrl+L 定位在某?(对于E序过100的h有音?<br> Ctrl+M 最大化当前的Edit或View (再按则反?<br> Ctrl+/ 注释当前?再按则取消注?br> Ctrl+O 快速显C?OutLine<br> Ctrl+T 快速显C当前类的承结?br> Ctrl+W 关闭当前Editer<br> Ctrl+K 参照选中的Word快速定位到下一?br> Ctrl+E 快速显C当前Editer的下拉列?如果当前面没有昄的用黑体表示)</p> <p>Ctrl+/(键? 折叠当前cM的所有代?/p> <p>Ctrl+×(键? 展开当前cM的所有代?/p> <p>Ctrl+Space 代码助手完成一些代码的插入(但一般和输入法有冲突,可以修改输入法的热键,也可以暂用Alt+/来代?</p> <p>Ctrl+Shift+E 昄理当前打开的所有的View的管理器(可以选择关闭,Ȁzȝ操作)</p> <p>Ctrl+J 正向增量查找(按下Ctrl+J?你所输入的每个字母编辑器都提供快速匹配定位到某个单词,如果没有,则在stutes line中显C没有找C,查一个单词时,特别实用,q个功能Idea两年前就有了)</p> <p>Ctrl+Shift+J 反向增量查找(和上条相?只不q是从后往前查)</p> <p>Ctrl+Shift+F4 关闭所有打开的Editer</p> <p>Ctrl+Shift+X 把当前选中的文本全部变呛_?/p> <p>Ctrl+Shift+Y 把当前选中的文本全部变为小?/p> <p>Ctrl+Shift+F 格式化当前代?/p> <p>Ctrl+Shift+P 定位到对于的匚wW?譬如{}) (从前面定位后面时,光标要在匚wW里?后面到前?则反?</p> <p>下面的快捷键是重构里面常用的,本hp己喜Ƣ且常用的整理一??一般重构的快捷键都是Alt+Shift开头的?</p> <p>Alt+Shift+R 重命?(是我自己最q的一个了,其是变量和cȝRename,比手工方法能节省很多力_?</p> <p>Alt+Shift+M 抽取Ҏ (q是重构里面最常用的方法之一?其是对一大堆泥团代码有用)</p> <p>Alt+Shift+C 修改函数l构(比较实用,有N个函数调用了q个Ҏ,修改一ơ搞?</p> <p>Alt+Shift+L 抽取本地变量( 可以直接把一些魔法数字和字符串抽取成一个变?其是多处调用的时?</p> <p>Alt+Shift+F 把Class中的local变量变ؓfield变量 (比较实用的功?</p> <p>Alt+Shift+I 合ƈ变量(可能q样说有点不妥Inline)<br> Alt+Shift+V Ud函数和变?不怎么常用)<br> Alt+Shift+Z 重构的后悔药(Undo) </p> </font> <img src ="http://m.tkk7.com/jaunt/aggbug/138999.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jaunt/" target="_blank">Jaunt</a> 2007-08-24 09:23 <a href="http://m.tkk7.com/jaunt/archive/2007/08/24/138999.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> Eclipse 的历双Ӏ现状和未来http://m.tkk7.com/jaunt/archive/2007/08/24/138998.htmlJauntJauntFri, 24 Aug 2007 01:21:00 GMThttp://m.tkk7.com/jaunt/archive/2007/08/24/138998.htmlhttp://m.tkk7.com/jaunt/comments/138998.htmlhttp://m.tkk7.com/jaunt/archive/2007/08/24/138998.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/138998.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/138998.html转蝲

来源:javaresearch

2001 q?nbsp;11 月,IBM 向开源社区捐献了 Eclipse 代码Q自?nbsp;Eclipse 在开发者社区得到飞速发展?006 q?nbsp;1? 19日,Eclipse 国际高峰论坛也首ơ登陆中国,在清华大学信息科学技术大gD行。在q次 Eclipse 大会?  developerWorks ~辑团队?nbsp;IBM ?nbsp;Eclipse {略l理 John Kellerman q行了谈,聆听了他?  Eclipse 历史的追溯、对 Eclipse 架构的分析、对 Eclipse 现状分析、对未来发展的展望?br>     John KellermanQIBM 软g?nbsp;Rational 产品ȝ理,?nbsp;1984 q加?nbsp;IBM, 一直从事应用开发工作? 2000 q初QJohn 开始加入了 Eclipse 目Q现在Q?nbsp;IBM Eclipse {略部ȝ理。他现在的主要工作是?  Eclipse 基金会、Eclipse C֌中代?nbsp;IBM 的利益,?nbsp;Eclipse 成员公司合作?br>
developerWorks: IBM 开发工L发展l历了从最初的 Visual AgeC天基?nbsp;Eclipse 3.0 的? 可以说是非常大的飞跃Q您可否l我们谈一下这其中的历Ԍ

John: 我在加入 Eclipse 目之前Q是 IBM Visual Age for SmallTalk 的品经理。Eclipse h? 一个非帔R要的原因是,当时IBM 面着一些挑战需要去解决Q即 IBM 开发工?nbsp;Visual Age for Java ?  WebSphere Studio 很难集成CP而且底层的技术比较脆弱,因此q一步发展非常艰难,无法满业界应用开发的需求?nbsp;
因此Q?998 q_我们开始了下一代开发工h术探索之路,成立了一个项目开发小l,l过两年的发展,2000q_我们军_l新一代开发工具项目命名ؓ  EclipseQEclipse 叫法当时只是内部使用的名U。这时候的商业目标是希望 Eclipse 目能够吸引开发h员,能发展v一个强大? 又充满活力的商业合作伙伴Q独立Y件供应商Q社区。同时我们意识到需要用它来Ҏ Microsoft Visual Studio 的发展,因此从商? 目标考虑Q通过开源的方式我们最有机会达到目的。此外,IBM 推出?nbsp;Eclipse 试用计划Q允?nbsp;IBM 以外的开发h员?nbsp;Eclipse? l果证明我们的决{非常正,Eclipse 从此在开发社区广为流传。Eclipse 也就成ؓq个目的正式名U?br>
我们认ؓ开?nbsp;Eclipse 不能只是单地贡献出源码,创徏一个开源项目然后放在开源许可证下;我们需要徏立v多家公司的合作关p,否则׃信服, 不是真正的开源项目,而只?nbsp;IBM 的一个项目。因此在 2000 q到 2001 q之_我做的主要工作就是去拜访一些公司,与他们谈?  Eclipse,邀请他们加?nbsp;Eclipse 目?nbsp;您可以想象,q是非常有趣的谈话,最l,我们?nbsp;8 家公司达成了一_其中包括一?  IBM 的竞争对?nbsp;WebGain、Borland, q有一些盟友如 RationalQRational 当时q没有被 IBM 收购Q?br>
2001 q?nbsp;12 月,IBM 向世界宣布了两g事,W一件是创徏开源项目,?nbsp;IBM 捐赠价?nbsp;4 千万元的源码给开源社区;另外一件事是成?  Eclipse 协会QEclipse ConsortiumQ?q个协会׃些成员公司组成,主要d是支持ƈ促进 Eclipse 开源项目?br>
从此Q我们看C Eclipse 本n、会员、插Ӟplug-inQ和 Eclipse C֌飞速成ѝ?003 q_我们意识到这U会员模式很难进 一步扩展,有些事务操作h很困难,比如无法{w赠款、无法成立合法理事会Q这主要是因?nbsp;Eclipse 协会不是一个法律上的实体;此外Q尽?  Eclipse 成功有目qQ但仍然有些业界成员没有加入Q他们认为是 Eclipse 的真正领D是 IBM。因此我们认识到创徏一个独立于  IBM ?nbsp;Eclipse 会?nbsp;Eclipse 的发展非常有? 于是 IBM 与其他成员公司合作v草了理条例Q准备成?  Eclipse 基金会(Eclipse FoundationQ?004 q初QEclipse 基金会正式成立?nbsp;

developerWorks: Eclipse ׃个很的核心和核心之上的大量插gl成Q这U插件式架构l当时的开发社区带来耳目一新的冲击。您能给我们介绍一?nbsp;Eclipse 插g架构吗?

John: 对于 Eclipse 插g架构Q一个很好的比喻?nbsp;Web 览器,它也有插ӞEclipse 插g和浏览器怼Q都是要解决扩展性问 题。对于一?nbsp;Web 览器,如果你想既能览多媒体动画,又想览 PDF 文gQ那么你需要两个不同的插gQ才能保证两U内定w能在 Web ? 览器中显C?nbsp;Eclipse 也一P通过它的插g模式我们可以安装不同的插件来q行 HTML 的编辑、数据库的设计、Java 开发、C++ 开? {等Q所有这些开发工作完全在一?nbsp;Eclipse 安装q_上进行。而且 Eclipse 模型所能做的远过了这些,理解 Eclipse 插g的关 键是首先要理?nbsp;Eclipse 扩展点,正是q个扩展点帮您在 Eclipse 中添加新功能。例如,如果希望在菜单中d一,是通过  Eclipse 扩展点实现的?br>
所以当 Eclipse 插g实现了一个扩展点Q就创徏了一个扩展,此外Q扩展还可以创徏自己的扩展点。这U插件模式的扩展和扩展点是递归的,而且被证? 是非常灵zȝ。记得当我们着手对 Eclipse 开发进行区域性调查时Q最初的军_之一是: "We will eat our own dog food"Q编者注Q谚语,指一个公司在日常q行中用自q产品Q,?nbsp;Eclipse 团队要 ?nbsp;Eclipse q行 Eclipse 的开发。事实上QEclipse 本n是一个核心的q行时绑定了一些在插g之上构徏的插Ӟ换句话说Q? Eclipse 本n是一pd的插件。这样随着使用 Eclipse 构徏 Eclipse 的经验篏U,q种插g模式变得日L熟?br>
developerWorks: IBM ?nbsp;Eclipse 已经投入了非常多的资源,IBM ?nbsp;Eclipse 的将来会扮演什么角色呢Q?br>
John: 目前 Eclipse 目?nbsp;100 多个QIBM 参与了其中超q一半的目Q有 3 个主在L Eclipse 相关的工作? 2005 q我们还赞助了一?nbsp;Eclipse 创新基金?nbsp;Eclipse 奖学金。IBM 承诺在未来的几年内会一如既往地参?nbsp;Eclipse ? IӞ我们会看到 IBM 研发出新目Q而在某些 Eclipse 目上减参与,q要?nbsp;IBM 的商业目标。最q我们提议了一个项目叫  Beacon, 是关?nbsp;Eclipse 程框架的。我们将捐献一?nbsp;Rational Unified Process (RUP) 技术,基本? q个提议是要提供程斚w的内宏VIBM 现在与一家叫?nbsp;Zend 的公司合作,希望?nbsp;Eclipse 上开发出用于 PHP 的开发工兗从商业? 面看 IBM, 您会发现 Eclipse ?nbsp;Rational 软g开发^台的基础。此外由?nbsp;Eclipse 的插件模式、扩展性、集成性,我们? Rational, WebSphere, Lotus ?nbsp;Tivoli 构徏了统一的^台?br>
developerWorks: 目前 IBM 的五大旗舰品牌都有基?nbsp;Eclipse 的? q对 IBM 有什么好处?

John: 我们的目标是创徏集成l一q_Q我们有Z Eclipse 构徏?nbsp;DB2, Rational, WebSphere {工Pq样客户 可以共同用这些工P有统一的界面风|使用h非常方便。对 IBM 自n来说Q各个开发部门就可以x于Y件的核心性能开发,而不必要费资源? 一些重新实现的工作Q从?nbsp;DB2 开发部门就专注于数据库开发、WebSphere 专注应用服务器的开发、Rational 专注于徏模、源代码? 理,至于其他斚w的辅助开发对?nbsp;Eclipse 来说是共同的?br>
developerWorks: Eclipse 是一个开?nbsp;IDE, 那如何通过 Eclipse 创造商业利益呢Q?br>
John: 对于 IBM, ?nbsp;Eclipse 技术开发方面与上百家公司合作,因ؓ IBM 看到?nbsp;Eclipse 作ؓ通用的、开攄、标准的技 术基Q其价值日益成ѝ当Ӟq种基础技术是不会带来创收的,没有人可以?nbsp;Eclipse 技术来赚钱Q但qƈ不重要,像 Borland,  Sybase {公叔R在花贚w做同L构徏工作Q当然我们在q方面还有合作,但是我们q专注于我们的核心功能lg构徏?nbsp;Eclipse q_上, 例如QIBM ?nbsp;Rational Application Developer, 它是使用 Eclipse 作ؓ基础Q然后在q基上添加了建模? 件、Web 开发插Ӟq有其它更有价值的插gQ这些插件我们是收费的。这是使用 Eclipse q行商业创收的模式之一?br> 此外Qh们还可以直接?nbsp;Eclipse 构徏插gQ然后出售这些插件来赚钱Q因为插件可以用商业许可证发行。事实上我们建立 Eclipse 公共? 可证Q就是ؓ了让 Eclipse 能很好的被商业采用,从而可以用它来赚钱QEclipse 的所有成员公司基本都是商业Y件提供商。目前全球有上百? 开发h员在使用 Eclipse, 因此中国开发h员完全可以构建有价值的插g和工P然后q行销售。同?nbsp;IBM 有一个合作伙伴计划,帮助合作伙伴? 传在 IBM Z Eclipse 的品之上构建的应用?br>
developerWorks: 富客Lq_(RCP)目前是比较流行的应用开发模式,误一?nbsp;Eclipse 是如何支持富客户端的Q?br>
John: ?nbsp;Eclipse 的早期,有些用户试图除了?nbsp;Eclipse用于开发工具基q_外,q用作更普遍的商业应用基。他们认Z?  IDE 是一个特D的富客L应用。这是开放源码开发的力所在,当这些用戯着?nbsp;Eclipse 作ؓ通用富客LӞ他们把q些x? 馈给 Eclipse 开发小l。就q样 Eclipse l过?nbsp;2.0 ?nbsp;2.1 的发展,不断收到来自C֌的徏议和反馈Q终于到了一个通用化的? Dc在3.0 版发行时Q我们觉得时机成熟,于是正式声明?nbsp;Eclipse 作ؓ通用的富客户端和 IDE?br>
其实最早的反馈是来自我们的 Lotus 开发小l,他们?nbsp;Eclipse 3.0 之前意识到可以使用 Eclipse 来提供他?  Workplace 客户端的富客L版本。从 Eclipse 3.0 ?nbsp;3.1 再到 3.2, 我们看到富客Lq_应用的快速增长,同时也收 到越来越多反馈帮我们完善提高?br>
我最ƣ赏?nbsp;RCP 应用之一是在EclipseCon 2005 上的一个演C,演示的是国国家航空航天理局(NASA)的一个项目,当时  NASA 在加利福g州有个实验室?nbsp;Jet Propulsion Laboratory (JPL)Q负责火星探计划,他们的管理用L面就? 一?nbsp;Eclipse RCP 应用Q通过q个应用Q加利福g州的工作人员可以控制在火星上运行的火星车。在演示q程中,有h问ؓ什么?  Eclipse, 回答是,使用 Eclipse q门技术,他们不用担心Q而且q节省了不少U税人的钱,因ؓ他们只需要集中资源开发控制火星R的应? 可以了?br>
developerWorks: Eclipse 现在非常热门Q您认ؓ从微软的开发^台{?nbsp;Eclipse 上容易吗Q?br>
John: q个问题可以从两斚w来说明,一是Y件提供商?nbsp;Visual Studio Ud Eclipse 上,另一斚w是微软^C开发的E序的移植?br>
Eclipse 提供了不同的集成ҎQ可以是非常轻量U的集成Q即只是单的调用和返回。Eclipse可以处理 ActiveX 控gQ这?  Word, Excel 可以在 Eclipse 里打开Q这是另一U集成模式。有些供应商选择把他们的工具装?nbsp;Java 层,即保?nbsp;C/C+ + 工具Q封装在 Java 里与 Eclipse q行通信。如果Y件供应商希望工h建成 Eclipse 插gQ那么我们通常?  Eclipse 中用 Java 重新实现Q因为几乎所有的微Y工具都是 C/C++ 工具。因此工Lq移可以分三步走Q轻量集成、重量集成和重 新实现?br>
如果要迁Uȝ序,Eclipse 提供了一些设施。但难易E度取决于程序是用什么工具开发的Q因为最重要的部分是Q版本控制系l的Q代码库本nQ如果代? 库同时支?nbsp;Visual Studio ?nbsp;Eclipse, 那就Ҏ的多。此外有一些公司提供了q移pȝQ在 Eclipse |站的社区部分中? 以查看这些公司列表?br>
developerWorks: 对个体开发h员,他们如何能够参与 Eclipse 目Q?br>
John: Eclipse 是完全开攄QQ何h都可以参与,参与的最单方法是x它的新闻l,选择一个感兴趣的技术领域,然后下蝲代码Q自己做些实 验,q在新闻l上回答一些问题,q样随着技术的提高Q就可以?nbsp;Bugzilla 提交 bug 和修复包Q或M复其?nbsp;bug。如果得到项目工作组? 认可Q便可以承担目的一些义务,成ؓ目开发组的真正成员。此外还可以写一些文章发送到 Eclipse l织Q参加本地的 Eclipse 用户l等 {方式?br>
如果有兴成立一?nbsp;Eclipse 开源项目,Eclipse 上有一个文?Eclipse Development Process",描述了如何操作?br>
developerWorks: 最后请l我们谈?nbsp;Eclipse 下个版本的情况?

John: Eclipse 3.2 计划于今q?nbsp;6 月面世,名称?nbsp;Callisto, 选择 Callisto 作ؓ名称是按C֌要求的,因ؓq次 目标是同时发?nbsp;10 个主要的 Eclipse 目Q以支持成员公司生态系l需求,他们要?nbsp;Eclipse 框架集成到各自的软g产品中?br>
developerWorks: 感谢您接受我们的采访?

Jaunt 2007-08-24 09:21 发表评论
]]>
Eclipse常用技?/title><link>http://m.tkk7.com/jaunt/archive/2007/03/21/105366.html</link><dc:creator>Jaunt</dc:creator><author>Jaunt</author><pubDate>Wed, 21 Mar 2007 12:52:00 GMT</pubDate><guid>http://m.tkk7.com/jaunt/archive/2007/03/21/105366.html</guid><wfw:comment>http://m.tkk7.com/jaunt/comments/105366.html</wfw:comment><comments>http://m.tkk7.com/jaunt/archive/2007/03/21/105366.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jaunt/comments/commentRss/105366.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jaunt/services/trackbacks/105366.html</trackback:ping><description><![CDATA[ <p>热键:<br />TemplateQAlt + /<br />修改处:H口->喜好讑֮->工作?>按键->~辑->内容辅助?br />个h习惯QShift+SPACE(I白)?br />易说明:~辑E序代码Ӟ打sysout +TemplateȀz键Q就<br />会自动出玎ͼSystem.out.println(); ?br />讑֮Template的格式:H口->喜好讑֮->Java->~辑?>模板?/p> <p>E序代码自动排版QCtrl+Shift+F<br />修改处:H口->喜好讑֮->工作?>按键->E序代码->格式?br />个h习惯QAlt+Z?br />自动排版讑֮Q窗?>喜好讑֮->Java->E序代码格式制作E序?br />样式面->插入tab(而非I格?以内~,该选项取消N?br />Q下面空格数目填4Q这样在自动~排时会以空?作羃排?/p> <p>快速执行程序:Ctrl + F11<br />个h习惯QALT+X<br />修改处:H口->喜好讑֮->工作?>按键->执行->Ȁzd一ơ的ȀzM业?br />易说明:W一ơ执行时Q它会询问您执行模式Q?br />讄好后Q以后只要按q个热键Q它׃快速执行?br /><ALT+Z(排版?、ATL+X(执行)>..我觉得很手^___^</p> <p>自动汇入所需要的cdQCtrl+Shift+O<br />易说明:<br />假设我们没有ImportMcdӞ当我们在E序里打入:</p> <p>BufferedReader buf =<br />new BufferedReader(new InputStreamReader(System.in));<br />此时Eclipse会警C没有汇入cdQ这时我们只要按下Ctrl+Shift+O<br />Q它׃自动帮我们Importcd?/p> <p>查看使用cd的原始码QCtrl+鼠标左键点击<br />易说明:可以看到您所使用cd的原始码?/p> <p>选取的文字批注v来:Ctrl+/<br />易说明:Debug时很方便?br />修改处:H口->喜好讑֮->工作?>按键->E序代码->Ҏ</p> <p>视景切换QCtrl+F8<br />个h习惯QAlt+S?br />修改处:H口->喜好讑֮->工作?>按键->H口->下一个视景?br />易说明:可以方便我们快速切换编辑、除错等视景?/p> <p>密技:<br />一套Eclipse可同时切换,英文、繁体、简体显C:<br />1.首先要先安装完中文化包?br />2.在桌面的快捷方式后面加上参数卛_Q?br />英文-> -nl "zh_US"<br />J体-> -nl "zh_TW"<br />?> -nl "zh_CN"?br />(其它语系以此cL)<br />像我2.1.2中文化后Q我在我桌面的Eclipse快捷方式加入参数-n1 "zh_US"?br />"C:\Program Files\eclipse\eclipse.exe" -n "zh_US"<br />接口׃变回英文语系噜?/p> <p>利用EclipseQ在Word~辑文书时可不必程序代码重新编排:<br />EclipseE序~辑区的E序代码整个复制下来(Ctrl+C)Q直接脓(Ctrl+V)?br />Word或WordPad上,您将会发现在Word里的E序代码格式Q跟Eclipse<br />所讑֮的完全一P包括字型、羃排、关键词颜色。我曾试qJBuilder<br />、GEL、NetBeans...使用复制贴上Ӟ只有~排格式一P字型、颜<br />色等都不会改变?/p> <p>外挂:<br />外挂安装Q将外挂包下载回来后Q将其解压羃后,您会发现features?br />pluginsq?个资料夹Q将里面的东襉K复制或移动到Eclipse的features<br />、plugins资料夹内后,重新ȀzEclipse卛_?/p> <p>让Eclipse可以像JBuilderX一样用拖拉方式徏构GUI的外挂:<br />1.Jigloo SWT/Swing GUI Builder Q?br /><a >http://cloudgarden.com/jigloo/index.html</a><br />下蝲此版本:Jigloo plugin for Eclipse (using Java 1.4 or 1.5)<br />安装后即可由档案->新徏->其它->GUI Form选取要徏构的GUIcd?/p> <p>2.Eclipse Visual Editor ProjectQ?br /><a >http://www.eclipse.org/vep/</a><br />炚w下方Download PageQ再炚wLatest Release 0.5.0q入下蝲?br />除了VE-runtime-0.5.0.zip要下载外Q以下这2个也要:<br />EMF build 1.1.1: (build page) (download zip) <br />GEF Build 2.1.2: (build page) (download zip) </p> <p>3.0 M8版本Q请下蝲Q?br />EMF build I200403250631<br />GEF Build I20040330<br />VE-runtime-1.0M1</p> <p>安装成功后,便可由File->New->Visual Class开始UI设计?br />安装成功后,卛_由新?>Java->AWT与Swing里选择<br />所要徏构的GUIcd开始进行设计。VE必须配合着对应<br />版本Q才能正怋用,否则即安装成功Q用上仍会<br />有问题?/p> <p>使用Eclipse来开发JSPE序Q?br />外挂名称Qlomboz(下蝲面)<br /><a >http://forge.objectweb.org/project/showfiles.php?group_id=97</a><br />请选择适合自己版本的lomboz下蝲Qlomboz.212.p1.zip表示2.1.2版,<br />lomboz.3m7.zip表示M7版本....以此cL?br />lomboz安装以及讄教学Q?br />Eclipse开发JSP-教学文g</p> <p>Java转exe:<br />实现方式QEclipse搭配JSmooth(免费)?br />1.先由Eclipse制作包含Manifest的JAR?br />制作教学<br />2.使用JSmooth做好的JAR包装成EXE?br />JSmooth下蝲面Q?br /><a >http://jsmooth.sourceforge.net/index.php</a><br />3.制作完成的exe文gQ可在有装置JRE的Windows上执行?/p> <p>Eclipse-Java~辑器最佌定:<br />~辑器字型设定:工作?>字型->Java~辑器文字字型?br />(讑֮Courier New -regular 10)</p> <p>~辑器相兌定:H口->喜好讑֮->Java->~辑?/p> <p>外观Q显C受强调对U显C的Ҏ受强调显C现行行?br />昄打印边距Q将其勾选,Tab宽度?Q打印编距字D设80?br />E序代码协助Q采预设卛_?br />语法Q可讑֮关键词、字W串{等的显C颜艌Ӏ?br />附注Q采预设卛_?br />输入Q全部字D都N?br />动说明Q采预设卛_?br />DQ采预设卛_?/p> <p>使自动排版排出来的效果,最W合Java设计惯例的设定:<br />自动排版讑֮Q窗?>喜好讑֮->Java->E序代码制作格式?/p> <p>换行Q全部不N?br />分行Q行长度上限设:80?br />样式Q只强制{型后插入I白N?br />内羃I格数目Q设??/p> <p>Eclipse的教学文Ӟ<br />sungo发表Q?br />Eclipse 3.0pd热键?- 中英对照解说?(by sungo) ~New~<br />Window+GCC+CDT用Eclipse开发C、C++ (by sungo) ~New~</p> <p>其它Q?br />扩充Eclipse的Java 开发工?中文)<br />使用Eclipse开发J2EE 应用E序(中文)<br />使用Eclipseq_q行除错(中文)<br />用Eclipseq行XML 开?中文)<br />开发Eclipse外挂E序(中文)<br />国际化您的Eclipse外挂E序(英文)<br />Swing~辑器加入Eclipse(英文)<br />如何试你的Eclipse plug-inW合国际市场需?英文)</p> <p>Eclipse的相关网站:<br /><a >http://eclipse-plugins.2y.net/eclipse/index.jsp</a><br /><a >http://www.eclipseplugincentral.com/</a><br />Eclipse相关教学[体]</p> <img src ="http://m.tkk7.com/jaunt/aggbug/105366.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jaunt/" target="_blank">Jaunt</a> 2007-03-21 20:52 <a href="http://m.tkk7.com/jaunt/archive/2007/03/21/105366.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>怎么栯决myeclipse资源文g中的中文~码问题http://m.tkk7.com/jaunt/archive/2006/12/15/87956.htmlJauntJauntFri, 15 Dec 2006 07:35:00 GMThttp://m.tkk7.com/jaunt/archive/2006/12/15/87956.htmlhttp://m.tkk7.com/jaunt/comments/87956.htmlhttp://m.tkk7.com/jaunt/archive/2006/12/15/87956.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/87956.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/87956.htmlҎ一: ~辑玩了后在dos在用jdk自带的native2ascii命o把资源文件{换一下就可以?br />
命o为native2ascii 资源文g?新的资源文g?
执行完后便会在新的资源文件中看见中文全变?u...什么了样子~~q样可以了

把旧的删?新的资源文g改回旧的资源文g?br />
Ҏ?使用插gPropertiesEdit,下蝲地址:
http://propedit.sourceforge.jp/eclipse/updates/

Ҏ? 修改properties的源代码.主要是修改saveConvert()Ҏ和loadConvert()ҎQ大家可以自己徏立一个类Q然后把propertiescȝ代码拯q来Q然后修改这两个Ҏ可以了?br />或者直接将我下面的代码拯q去可以了?br />
package xiaotang.util;
import java.util.*;
package xiaotang.util;

import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Hashtable;
import java.util.*;
/**
*
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: 哈尔滨商业大?lt;/p>
*
* @author Onlyfor_love
* @version 1.0
*/

public class PropertiesExt extends Hashtable {

private static final long serialVersionUID = 4112578634029874840L;
protected PropertiesExt defaults;
public PropertiesExt() {
this(null);
}
public PropertiesExt(PropertiesExt defaults) {
this.defaults = defaults;
}
public synchronized Object setProperty(String key, String value) {
return put(key, value);
}

private static final String keyValueSeparators = "=: \t\r\n\f";

private static final String strictKeyValueSeparators = "=:";

private static final String specialSaveChars = "=: \t\r\n\f#!";

private static final String whiteSpaceChars = " \t\r\n\f";

public synchronized void load(InputStream inStream) throws IOException {
//把所有的8859-1全部换成GBK
BufferedReader in = new BufferedReader(new InputStreamReader(inStream, "GBK"));
while (true) {
// Get next line
String line = in.readLine();
if (line == null)
return;

if (line.length() > 0) {

// Find start of key
int len = line.length();
int keyStart;
for (keyStart=0; keyStart<len; keyStart++)
if (whiteSpaceChars.indexOf(line.charAt(keyStart)) == -1)
break;

// Blank lines are ignored
if (keyStart == len)
continue;

// Continue lines that end in slashes if they are not comments
char firstChar = line.charAt(keyStart);
if ((firstChar != '#') && (firstChar != '!')) {
while (continueLine(line)) {
String nextLine = in.readLine();
if (nextLine == null)
nextLine = "";
String loppedLine = line.substring(0, len-1);
// Advance beyond whitespace on new line
int startIndex;
for (startIndex=0; startIndex<nextLine.length(); startIndex++)
if (whiteSpaceChars.indexOf(nextLine.charAt(startIndex)) == -1)
break;
nextLine = nextLine.substring(startIndex,nextLine.length());
line = new String(loppedLine+nextLine);
len = line.length();
}

// Find separation between key and value
int separatorIndex;
for (separatorIndex=keyStart; separatorIndex<len; separatorIndex++) {
char currentChar = line.charAt(separatorIndex);
if (currentChar == '\\')
separatorIndex++;
else if (keyValueSeparators.indexOf(currentChar) != -1)
break;
}

// Skip over whitespace after key if any
int valueIndex;
for (valueIndex=separatorIndex; valueIndex<len; valueIndex++)
if (whiteSpaceChars.indexOf(line.charAt(valueIndex)) == -1)
break;

// Skip over one non whitespace key value separators if any
if (valueIndex < len)
if (strictKeyValueSeparators.indexOf(line.charAt(valueIndex)) != -1)
valueIndex++;

// Skip over white space after other separators if any
while (valueIndex < len) {
if (whiteSpaceChars.indexOf(line.charAt(valueIndex)) == -1)
break;
valueIndex++;
}
String key = line.substring(keyStart, separatorIndex);
String value = (separatorIndex < len) ? line.substring(valueIndex, len) : "";

// Convert then store key and value
key = loadConvert(key);
value = loadConvert(value);
put(key, value);
}
}
}
}

/*
* Returns true if the given line is a line that must
* be appended to the next line
*/
private boolean continueLine(String line) {
int slashCount = 0;
int index = line.length() - 1;
while ((index >= 0) && (line.charAt(index--) == '\\'))
slashCount++;
return (slashCount % 2 == 1);
}

/**
*
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: 哈尔滨商业大?lt;/p>
*
* @author Onlyfor_love
* @version 1.0
*/
private String loadConvert(String theString) {
//该功能主要是存储的key和value提取出来Q因为存储的中文在原来的propertiescM被{换成了别的编?br />//存储的中文在*.properties文g中以q出现
char aChar;
int len = theString.length();
StringBuffer outBuffer = new StringBuffer(len);
//
// for (int x=0; x<len; ) {
// aChar = theString.charAt(x++);
// if (aChar == '\\') {
// aChar = theString.charAt(x++);
// if (aChar == 'u') {
// // Read the xxxx
// int value=0;
// for (int i=0; i<4; i++) {
// aChar = theString.charAt(x++);
// switch (aChar) {
// case '0': case '1': case '2': case '3': case '4':
// case '5': case '6': case '7': case '8': case '9':
// value = (value << 4) + aChar - '0';
// break;
// case 'a': case 'b': case 'c':
// case 'd': case 'e': case 'f':
// value = (value << 4) + 10 + aChar - 'a';
// break;
// case 'A': case 'B': case 'C':
// case 'D': case 'E': case 'F':
// value = (value << 4) + 10 + aChar - 'A';
// break;
// default:
// throw new IllegalArgumentException(
// "Malformed \\uxxxx encoding.");
// }
// }
// outBuffer.append((char)value);
// } else {
// if (aChar == 't') aChar = '\t';
// else if (aChar == 'r') aChar = '\r';
// else if (aChar == 'n') aChar = '\n';
// else if (aChar == 'f') aChar = '\f';
// outBuffer.append(aChar);
// }
// } else
outBuffer.append(theString);
// }
return outBuffer.toString();
}

/**
*
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: 哈尔滨商业大?lt;/p>
*
* @author Onlyfor_love
* @version 1.0
*/

private String saveConvert(String theString, boolean escapeSpace) {
//该功能主要是存储key和valueQ因Z文的存储在原来的propertiescM被{换成了别的编?br />//存储的中文在*.properties文g中以q出现
int len = theString.length();
StringBuffer outBuffer = new StringBuffer(len*2);
outBuffer.append(theString);

// for(int x=0; x<len; x++) {
// char aChar = theString.charAt(x);
// switch(aChar) {
// case ' ':
// if (x == 0 || escapeSpace)
// outBuffer.append('\\');
//
// outBuffer.append(' ');
// break;
// case '\\':outBuffer.append('\\'); outBuffer.append('\\');
// break;
// case '\t':outBuffer.append('\\'); outBuffer.append('t');
// break;
// case '\n':outBuffer.append('\\'); outBuffer.append('n');
// break;
// case '\r':outBuffer.append('\\'); outBuffer.append('r');
// break;
// case '\f':outBuffer.append('\\'); outBuffer.append('f');
// break;
// default:
//
// if ((aChar < 0x0020) || (aChar > 0x007e)) {
// outBuffer.append('\\');
// outBuffer.append('u');
// outBuffer.append(toHex((aChar >> 12) & 0xF));
// outBuffer.append(toHex((aChar >> 8) & 0xF));
// outBuffer.append(toHex((aChar >> 4) & 0xF));
// outBuffer.append(toHex( aChar & 0xF));
// } else {
// if (specialSaveChars.indexOf(aChar) != -1)
// outBuffer.append('\\');
// outBuffer.append(aChar);
// }
// }
// }
return outBuffer.toString();
}

/**
* Calls the <code>store(OutputStream out, String header)</code> method
* and suppresses IOExceptions that were thrown.
*
* @deprecated This method does not throw an IOException if an I/O error
* occurs while saving the property list. As of the Java 2 platform v1.2, the preferred
* way to save a properties list is via the <code>store(OutputStream out,
* String header)</code> method.
*
* @param out an output stream.
* @param header a description of the property list.
* @exception ClassCastException if this <code>Properties</code> object
* contains any keys or values that are not <code>Strings</code>.
*/
public synchronized void save(OutputStream out, String header) {
try {
store(out, header);
} catch (IOException e) {
}
}

public synchronized void store(OutputStream out, String header)
throws IOException
{
BufferedWriter awriter;
awriter = new BufferedWriter(new OutputStreamWriter(out, "GBK"));
if (header != null)
writeln(awriter, "#" + header);
writeln(awriter, "#" + new Date().toString());
for (Enumeration e = keys(); e.hasMoreElements();) {
String key = (String)e.nextElement();
String val = (String)get(key);
key = saveConvert(key, false);

/* No need to escape embedded and trailing spaces for value, hence
* pass false to flag.
*/
val = saveConvert(val, false);
writeln(awriter, key + "=" + val);
}
awriter.flush();
}

private static void writeln(BufferedWriter bw, String s) throws IOException {
bw.write(s);
bw.newLine();
}

public String getProperty(String key) {
Object oval = super.get(key);
String sval = (oval instanceof String) ? (String)oval : null;
return ((sval == null) && (defaults != null)) ? defaults.getProperty(key) : sval;
}

public String getProperty(String key, String defaultValue) {
String val = getProperty(key);
return (val == null) ? defaultValue : val;
}

public Enumeration propertyNames() {
Hashtable h = new Hashtable();
enumerate(h);
return h.keys();
}

public void list(PrintStream out) {
out.println("-- listing properties --");
Hashtable h = new Hashtable();
enumerate(h);
for (Enumeration e = h.keys() ; e.hasMoreElements() ;) {
String key = (String)e.nextElement();
String val = (String)h.get(key);
if (val.length() > 40) {
val = val.substring(0, 37) + "...";
}
out.println(key + "=" + val);
}
}

public void list(PrintWriter out) {
out.println("-- listing properties --");
Hashtable h = new Hashtable();
enumerate(h);
for (Enumeration e = h.keys() ; e.hasMoreElements() ;) {
String key = (String)e.nextElement();
String val = (String)h.get(key);
if (val.length() > 40) {
val = val.substring(0, 37) + "...";
}
out.println(key + "=" + val);
}
}

private synchronized void enumerate(Hashtable h) {
if (defaults != null) {
defaults.enumerate(h);
}
for (Enumeration e = keys() ; e.hasMoreElements() ;) {
String key = (String)e.nextElement();
h.put(key, get(key));
}
}

private static char toHex(int nibble) {
return hexDigit[(nibble & 0xF)];
}

/** A table of hex digits */
private static final char[] hexDigit = {
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
};
}


/////////////////////////////////////////////////////////////////
然后写一个常用的配置文g操作c:
package xiaotang.util;
import java.io.*;

public class writeToProperty {
private String fileName;
private PropertiesExt prop = new PropertiesExt();
private InputStream fileStream = null;
private OutputStream outStream = null;
/**
*构造函?br />* @param fileName 文g名字Q包含\?br />*/
public writeToProperty(String fileName) {
this.fileName = fileName;
}

//d文gQ不存在则创建文?br />private void readFile() {
try {
File f = new File(fileName);
fileStream = new FileInputStream(f);
prop.load(fileStream);
}
catch (Exception e) {
e.printStackTrace();
}
finally {
try {
if (fileStream != null)
fileStream.close();
}
catch (IOException ex) {
ex.printStackTrace();
}
}

}

private void writeFile() {
try {
File f = new File(fileName);
outStream = new FileOutputStream(f);
}
catch (Exception e) {
e.printStackTrace();
}
}

/**
* q回指定key的vlaue
* @param key
* @return
*/
public String getValue(String key) {
readFile();
if (key != null && !key.equals(""))
return prop.getProperty(key);
else
return "";
}

/**
*q回指定key的vlaue,如果key不存在则q回defaultValue?br />* @param key
* @param defaultValue
* @return
*/
public String getValue(String key, String defaultValue) {
if (key != null && !key.equals(""))
return prop.getProperty(key, defaultValue);
else
return "";
}

/**
* 讄对应key的数|如果key存在的覆盖value的数|如果key不存则创?br />* @param key
* @param value
*/
public void setValue(String key, String value) {
readFile();
writeFile();
prop.setProperty(key, value);
try {
prop.store(outStream, "GBK");
}
catch (IOException ex) {
ex.printStackTrace();
}
finally {
try {
outStream.close();
}
catch (IOException ex1) {
ex1.printStackTrace();
}
}
}
}
////////////////////////////////////////////////////////////
接着写一个测试类可以了Q?br />package xiaotang.util;

import xiaotang.util.PropertiesExt;
import java.io.*;
/**
*
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: 哈尔滨商业大?lt;/p>
*
* @author Onlyfor_love
* @version 1.0
*/
public class PropertyFile {
public static void main(String[] args) {
writeToProperty wt = new writeToProperty("d:\\config1.properties");
wt.setValue("一","我是谁?");
wt.setValue("?,"我是陈晓?);
String one = wt.getValue("一");
String two = wt.getValue("?);
System.out.println(one);
System.out.println(two);
}

}
回头你再看看你的配置文gQ中文依然是中文?/p>

原蝲:http://m.tkk7.com/rickhunter/articles/16180.html



Jaunt 2006-12-15 15:35 发表评论
]]>
一个理解“单例模式”最好的例子http://m.tkk7.com/jaunt/archive/2006/11/26/83596.htmlJauntJauntSun, 26 Nov 2006 05:57:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/26/83596.htmlhttp://m.tkk7.com/jaunt/comments/83596.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/26/83596.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83596.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83596.html

原文出处: http://www.javatang.com/archives/2006/06/27/512049.html
~辑: Jaunt
声明: L持文章的完整性Q意{?/font>

SingletonTest.javaQ?/strong>


public class SingletonTest {
    public static void main(String[] args) {
        Singleton s1 = Singleton.getInstance();
        Singleton s2 = Singleton.getInstance();
        System.out.println("s1=s2?" + (s1==s2));
        System.out.println("s1.getNextID = " + s1.getNextID());
        System.out.println("s2.getNextID = " + s2.getNextID());
        System.out.println("s1.getNextID = " + s1.getNextID());
        System.out.println("s1.getNextID = " + s1.getNextID());
        System.out.println("s2.getNextID = " + s2.getNextID());
        System.out.println("s2.getNextID = " + s2.getNextID());
    }
}

class Singleton {
    private static int nextID = 0;
    private static Singleton instance = null;

    private Singleton() {};

    public static synchronized Singleton getInstance() {
        if (instance == null) {
            instance = new Singleton();
        }
        return instance;
    }
    // inside data
    public synchronized int getNextID() {
        return ++nextID;
    }
}

输出l果Q?/strong>

s1=s2?true
s1.getNextID = 1
s2.getNextID = 2
s1.getNextID = 3
s1.getNextID = 4
s2.getNextID = 5
s2.getNextID = 6



Jaunt 2006-11-26 13:57 发表评论
]]>
E序员自创的一首歌 - “Java EE 5?/title><link>http://m.tkk7.com/jaunt/archive/2006/11/26/83552.html</link><dc:creator>Jaunt</dc:creator><author>Jaunt</author><pubDate>Sat, 25 Nov 2006 18:47:00 GMT</pubDate><guid>http://m.tkk7.com/jaunt/archive/2006/11/26/83552.html</guid><wfw:comment>http://m.tkk7.com/jaunt/comments/83552.html</wfw:comment><comments>http://m.tkk7.com/jaunt/archive/2006/11/26/83552.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jaunt/comments/commentRss/83552.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jaunt/services/trackbacks/83552.html</trackback:ping><description><![CDATA[ <div id="myamwmu" class="storycontent"> <p>Sun公司一名员工自己创作的歌,关于Java EE 5Q很有意思的一首歌Q程序员业余生活也可以这么丰富!</p> <blockquote> <p>Ladies and gentlemen, this is Java EE 5! </p> <p>One, two, three, four, five<br />There’s a technology I use day and night<br />For my application with a web frontend<br />They told me to use .Net<br />But I really don´t wanna </p> <p>So many bugs I fixed last week.<br />My code is neat and talk is a cheap<br />I like Glassfish, JSF, persistence API<br />And as I continue you know they´re gettin´ sweeter </p> <p>So what can I do I really beg you my Lord<br />To me codin?it´s just like a sport<br />All the bad code from the past, let me dump it<br />Please set in the trumpet </p> <p>A little bit of injection in my life<br />A little bit of persistence by my side<br />A little bit of NetBeans is all I need<br />A little bit of EJB’s what I see<br />A little bit of standards in the sun<br />A little bit of XML all night long<br />A little bit web services here I am<br />A little bit of code makes me real man </p> <p>This is Java EE 5! </p> <p>Jump up and down and move your code around<br />Shake your head to the sound bury bad code under ground<br />Move one step left and one step right<br />One to the front and one to the side<br />Refactor it once and refactor it twice<br />If it looks like this you’re doin´ it right </p> <p>A little bit of injection in my life<br />A little bit of persistence by my side<br />A little bit of NetBeans is all I need<br />A little bit of EJB’s is what I see<br />A little bit of standards in the sun<br />A little bit of XML all night long<br />A little bit web services here I am<br />A little bit of code makes me real man </p> <p>This is Java EE 5! </p> <p> <br />MP3地址下蝲Q?a >q程</a>  <a >本地</a></p> </blockquote> </div> <img src ="http://m.tkk7.com/jaunt/aggbug/83552.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jaunt/" target="_blank">Jaunt</a> 2006-11-26 02:47 <a href="http://m.tkk7.com/jaunt/archive/2006/11/26/83552.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java十大事g之十QJava 5.0Q{载)http://m.tkk7.com/jaunt/archive/2006/11/24/83290.htmlJauntJauntFri, 24 Nov 2006 08:02:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/24/83290.htmlhttp://m.tkk7.com/jaunt/comments/83290.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/24/83290.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83290.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83290.htmlJava来有影响力了…?Tiger"代表什么,D虎一L威力吗?一句话QJava Q I  love you Q?/font>

2004QJava 5.0
                                                                                                  莫映 / ?br />
2004q??0日,代号为“Tiger”,研发历时q三q的J2SE 5.0发布正式版本Q这是Javaq_历来发布版本中改动面波及最大的一ơ?br />
U观TigerQ“Ease of development”是其核心主题,q一点着重体C语言Ҏ上的改q,q在很大E度上,化了开发h员日常的~程dQ以往一些琐的手工力_都代之以L自然Q而又安全可靠的自动化实现。其中的注解功能Q以及随之而来的声明式~程Q还Ҏ{于J2SE 5.0之上的J2EE 5.0产生了巨大媄响。尽Tiger在语aҎ上做了很大的动作,但作为Java技术的基础支撑Q这些改动都是深思熟虑的l果?br />
Tiger发布至今也有大半q了Q那么Sun又是如何规划J2SE的未来蓝囄呢?据悉QJ2SE的下两个版本分别是代号ؓ“Mustang”的J2SE 6.0和代号ؓ“Dolphin”的J2SE 7.0Q预计Mustang于明年发布。在吸取了Tiger研发周期q长的教训之后,Sun副总裁Graham Hamilton表示QMustang的发布周期将不会那么ѝƈ且,Sunq将“Becoming more open”作为Mustang的主题之一。未来JCP对Java技术的影响会愈加深入Q而整个研发过E也会愈加透明。Mustang在正式发布前的内部版本也会陆l见怺众,如此Q广大Java开发者便可以更加及时的了解到Java发展的最新情c?br />
在语a层面上的扩展依然会比较}慎,比如像AOPq样的当下热门技术,依然不太可能会见诸其中。据Hamilton所aQ一个有可能被引入的语法Ҏ被UC“friends”import机制Q它由多个包l成的大型项目变得易于管理?img src ="http://m.tkk7.com/jaunt/aggbug/83290.html" width = "1" height = "1" />

Jaunt 2006-11-24 16:02 发表评论
]]>
Java十大事g之九QJBoss和Eclipse Q{载)http://m.tkk7.com/jaunt/archive/2006/11/24/83286.htmlJauntJauntFri, 24 Nov 2006 07:51:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/24/83286.htmlhttp://m.tkk7.com/jaunt/comments/83286.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/24/83286.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83286.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83286.htmlEclipse实是一个很好的开源工P其MyEclipse插gQ如果一些程序员把Eclipse里面提示为来提高效率Q省得去写的话,我很不提倡这U做法!因ؓ它会让一个程序员变“懒惰”v来了Q个人比较喜ƢEmacs文本~辑器,也是一个很的发开工具Q一担你用习惯发挥的功能很强大…?/font>   Jaunt
2000-2004QJBoss和Eclipse——Java开源Y件的王?br />                                                                                                        莫映 / ?br />
Java 和开源几乎就是天生的一对,q可以从无比兴盛J荣的Java开源Y件社区得C证。目前最有媄响力的Java开源Y仉目,要数JBoss?Eclipse。可以说Q几乎所有的Java开发h员都获多或少的听到过或接触和使用q它们。前者是目前最优秀、应用最为广泛的企业U开源J2EE应用服务器,后者是功能完全可以替代商业产品的Java IDE。二者的覆盖功能之全、支持工具之qѝ子目之多Q几乎可以仅凭借它俩来完成企业应用的开发构建到部v实施的全q程Q而Y件开发者和客户也都可以最大程度上享受高质量,高可靠Java开源Y件所带来的低成本优势?br />
JBoss和Eclipse的巨大成功,几乎令各自领域的商用竞争者抓狂,其中 BEA的WebLogic和IBM的WebSphere在商业利润上受到JBoss的巨大R蚀Q而Borland的JBuilder、JetBrains 的IDEA{诸多优U的商用开发工具也不得不面对Eclipse独大的现实。JBoss的CEO兼创始hMarc Fleury曄a不讳地表C,希望占据市场dC。“我们希望打败IBMQ成Z间g领域里最大的厂商。”JBoss?.0以前q只是以一?Group存在Q盈利手D主要靠服务和销售文。但在最q,JBoss已经发展成ؓ一个有限公司,q吸U_安险投资,专注于获取利润ؓ目标之一的第二代开源Y件模式(JBoss自己UCؓ“Professional Open Source”)的创新和q营。这区别于以理论研究为爱好的学院型开源或大公ؓ基础的非盈利l织开源,如Linux和Apache。当然JBoss的这U运营方式势必会D更多的代码控制和专有修改权,但按JBoss的说法是q样更能获得企业客户的信赖。JBoss的这U模式是否能获得成功q要我们拭目以待?br />
不管JBoss和Eclipse的未来发展如何,JBoss和Eclipse的成功已l让我们看到了Java开源Y件的威力Q祝愿它们一路走好。?br />
Trackback:http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350883.aspx


Jaunt 2006-11-24 15:51 发表评论
]]>
Java十大事g之八Q官司最l以喜剧收场Q{载)http://m.tkk7.com/jaunt/archive/2006/11/24/83272.htmlJauntJauntFri, 24 Nov 2006 07:20:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/24/83272.htmlhttp://m.tkk7.com/jaunt/comments/83272.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/24/83272.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83272.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83272.html 好友易求Q知已难寻!"Z??公司与公?本存在性质上的不同Q公司是建立在商业性,利益性基上的。其实h与代码也能成为知己:
      代码带有人性,你越是轻视她Q越是看不v她,是对她不尊重,你能从她w上得到的回报率小Q甚臛_q可能让你损失惨重。?br />      代码h人性,那是因ؓҎ人写的,里面夹者开发者对她的情A。开发者对Ҏ情越深,Ҏ表现得越Q她p健康Q对你的回报大。           ?Jaunt


2002-2004QSun与微软的法律撞最l以喜剧收场
                                                                                                                         恉 / ?br />
2003q?? 日,Sun与微软达?6亿美元的法律和解。如果不是晚了一天,许多Z以ؓq是一个在4?日愚开的玩W。尽当时所有h都像是看到“太阳从西边出来了”那样张大了嘴巴Q但q的是事实?br />
Ҏ两家公司达成的版权协议,双方会ؓ采用Ҏ的技术而支付专利费用,微Y向Sun提前支付3.5亿美元用费QSun则承诺,如果Sun集成微Y的某些技术,也会向微软付ƾ。毫无疑问,“私下了l”的方式对双方而言都是最好的l果。就在协议签|的当天Q在国旧金qSun和微软ؓ“抛弃十q恩怨、携手合作“D行的新闻发布会上Q尽比•盖茨没有到场,但这q没有防现场看h异常L的气氛。麦克尼利和鲍尔默各自穿了一件密歇根州底特律“Red Wings”曲球队的q动服,q谈及了一起在哈佛大学M的经历,麦克利q说Q“当时我们两人是非常要好的朋友,当然我们也有吉|的时候。?br />
Z人当然可能成为终生的知己Q但是公怸公司之间有的只能是利益上的分分合?/font>?br />
Trackback:http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350868.aspx



Jaunt 2006-11-24 15:20 发表评论
]]>
Java十大事g之七QWebLogic打开J2EE的魔匣(转蝲Q?/title><link>http://m.tkk7.com/jaunt/archive/2006/11/24/83261.html</link><dc:creator>Jaunt</dc:creator><author>Jaunt</author><pubDate>Fri, 24 Nov 2006 07:05:00 GMT</pubDate><guid>http://m.tkk7.com/jaunt/archive/2006/11/24/83261.html</guid><wfw:comment>http://m.tkk7.com/jaunt/comments/83261.html</wfw:comment><comments>http://m.tkk7.com/jaunt/archive/2006/11/24/83261.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jaunt/comments/commentRss/83261.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jaunt/services/trackbacks/83261.html</trackback:ping><description><![CDATA[ <font color="#0000ff">虽然我不怎么用WebLogic ServerQ只用Tomcat多点Q但也感觉到WebLogic Server不错…?/font> <br /> <br />1998QWebLogic打开J2EE的魔?br />                                                                                                    霍泰E?/ ?br /><br />Java 语言的出C得互联网l有了良好的交互性能Q但q些很“酷”的技术仅被h们认为是一些小花招Q它q无法消除企业用户对它的怀疑?998q_BEA公司宣布收购WebLogic公司Qƈ接着推出由Sun公司W一个授权用J2EE许可证的WebLogic Server应用服务器,q个Java版的AppServer一推出引起业界极大的兴趣。WebLoigc Server以其Ҏ准的支持、强悍的q算能力和安全的架构设计{特性也很快征服了那些怀疑J2EE应用的h们。推出市场后不到一q_WebLogic Server成Z内第一Java应用服务器?br /><br />q里我们援引一些当时著名咨询公司的调查数据来说明问题,“在IDC的报告中QBEA在应用服务器和交易服务器领域市场份额W一Q在Gartner的报告中QBEA WebLogic Server拥有业内最q泛的EJB应用安装基础Q在Giga Group的报告中QBEA WebLogic Server市场份额?2%”。因为应用服务器市场极大的发展潜力,在WebLogic Server之后Q其它的很多公司也推Z自己的AppServerQ如IBM的WebSphere、Sun公司的iPlanet{,逐渐地应用服务器取代了传l意义上的各cM间gQ成Z业应用的基础q_。应用服务器的出C得Java有了真正意义上的发展?br /><br />Trackback:<a >http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350861.aspx</a><img src ="http://m.tkk7.com/jaunt/aggbug/83261.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jaunt/" target="_blank">Jaunt</a> 2006-11-24 15:05 <a href="http://m.tkk7.com/jaunt/archive/2006/11/24/83261.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java十大事g之六QJava开源社开始蓬勃发展(转蝲Q?/title><link>http://m.tkk7.com/jaunt/archive/2006/11/24/83245.html</link><dc:creator>Jaunt</dc:creator><author>Jaunt</author><pubDate>Fri, 24 Nov 2006 06:24:00 GMT</pubDate><guid>http://m.tkk7.com/jaunt/archive/2006/11/24/83245.html</guid><wfw:comment>http://m.tkk7.com/jaunt/comments/83245.html</wfw:comment><comments>http://m.tkk7.com/jaunt/archive/2006/11/24/83245.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jaunt/comments/commentRss/83245.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jaunt/services/trackbacks/83245.html</trackback:ping><description><![CDATA[ <font color="#0000ff">软g开发是一U似艺术创作Q不只是gQ已l是一U艺术了Q记得Pete McBreen所著的Software CraftsmanshipQ中文版名ؓ《Y件工艺》,人民邮电出版Cև版)出版后,“Y件工艺”ؓ软g行业的从业者带来了“Y件工E”之外的另一个重要的隐喻。在此之前,“Y件工E?q个隐喻在Y件行业中一直占据着l对的话语权。Y件工艺ƈ非是Zd颠覆软g工程Q而是Z促大家目光更多地投向_软g建造过E中的工艺问题。这本书Y件开发者分成了三个层次Q学徒开发者(Apprentice DeveloperQ、技师开发者(Journeymen DeveloperQ和软g工匠QCraftsmanQ。有Z中国软gIT问题Q?font style="BACKGROUND-COLOR: #66ccff">国内的Y件行业正是缺乏一大批对于自己的工作精益求_软g工匠Q这才是国内软g行业的主要问题所?/font>。本人极力支持这L说法Q同旉默在?软g工匠"的目标而奋斗著…?Jaunt <br /></font> <br />1998QJCP成立q正式运作,Java开源社开始蓬勃发?br />                                                                                                        黄v?/ ?br /><br />1998 q_JCPl织成立Qƈ且开始把握Java的发展方向。JCPl织的开放性,不但使得所有对Java感兴的商业公司可以参与Java的发展,更重要的?JCP允许个h、非盈利l织、学校等加入Q这qJava带来了巨大的zd。随之兴LJava开源运动的最大A献是实现和鼓׃知识׃nQ在众多热情的开源程序员们的努力和分享下Q很多原先只被商业公司掌握的技术、思想和品可以被所有需要的开发h员免Ҏ者以较低的hD得用权Qƈ通过开放源代码更容易的获得反馈和改q意见从而进一步演化发展?br /><br />我们知道Q?font color="#008000"><strong>所谓知识不是孤立发展认知,而是Z的经验,认识是思考交和U篏的?/strong></font>。而开源运动所带来的开放、反馈、交的风气正是W合人类C会知识形成和发展的规律?br /><br />开源运动v源于西方的发辑֛Ӟ有其现实背景和文化根源?990q代可以说是IT 产业的一个黄金时代。信息时代的兴v对IT人员Q特别是软g人员有着巨大的需求。?font color="#008000"><strong>软g开发又是一U类D术创作的脑力zdQ和所有的艺术家、作家们一P在作品打上自q印记q流传在世界上是每一个创作h员的梦想?/strong></font>互联|时代下的高收入的舒适生z,早九晚五的编写公司的代码q不能满_多有Ȁ情的软g开发h员的梦想Q再加上西方传统的基督教文化中十分推崇的分n和交,开源的出现和兴起也水到渠成了?br /><br />今天Q开源运动已l不仅仅是一些个人天才程序员们的怹园地Q而是发展成ؓ一开源Y件业?br /><br />Trackback:<a >http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350858.aspx</a><img src ="http://m.tkk7.com/jaunt/aggbug/83245.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jaunt/" target="_blank">Jaunt</a> 2006-11-24 14:24 <a href="http://m.tkk7.com/jaunt/archive/2006/11/24/83245.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java十大事g之五QJava 2q_发布Q{载)http://m.tkk7.com/jaunt/archive/2006/11/24/83236.htmlJauntJauntFri, 24 Nov 2006 05:29:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/24/83236.htmlhttp://m.tkk7.com/jaunt/comments/83236.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/24/83236.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83236.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83236.htmlM一门程序语a都要l历q岁月的考验Q市场的竞争才走向更成熟Q体现出价值的存在Q生命期的长短!好坚信比•盖茨给予了q样的评P?strong>Java是很长时间以来最优秀的程序设计语a?/font>
?br />                                                            Jaunt

1998QJava 2q_发布
                                                                                                                 陶文 / ?br />
1998 q_Java 2q_正式发布。经q了三年旉的发展、热热闹闹的d宣传、红U火火的众厂商的热情参与QSunl于知道Java适合q什么了。对比Java刚发明时的技术定位,与Java的戏剧性触“网”的那段历史QJava 2q_的发布可真算得上是有的放矢了?br />
Ҏ官方的文,Java 2是Sun意识到“one size doesn’t fit all”之后,把最初的Java技术打包成三个版本的物,也就是著名的J2ME、J2SE、J2EE。之所以说Java自从Java 2q_发布之后Q进入了C。那是因Z前的历史怎么看来都和现在E序员日常开发用的技术无什么关p,比如AppletQ已l很有Z用了。Java 2之后的历史就不一样了Q至h们在推崇轻量U开发,猛批EJB时还不时会引用J2EEq个词是如何诞生的。而Java 2的三大版本中Q除了J2EE得到了长_展和q泛使用之外QJ2ME也在手机市场上取得了遍地开ql果。相较之下,J2SE隑օ落寞Q只剩SWTq个血l不U的家伙在Rich Client回归的时代吸引着Z的眼球了?br />
无论今天看来当时的Java 2有多么的不成熟,臛_l过市场和时间的验,Java 2规划出来的三大方向把Java技术指向了光明的方向是勿庸|疑的?br />
Trackback:http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350825.aspx

Jaunt 2006-11-24 13:29 发表评论
]]>Java十大事g之四Q微软与Sun的Java官司Q{载)http://m.tkk7.com/jaunt/archive/2006/11/24/83226.htmlJauntJauntFri, 24 Nov 2006 05:13:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/24/83226.htmlhttp://m.tkk7.com/jaunt/comments/83226.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/24/83226.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83226.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83226.html本hq不怎么看好微YQ或许它也有些优势,但觉得它商业化了Q技术水q高不到哪里去,但ƈ不是否认没有技术,M企业如果把技术当成商业利润ؓ最l目的都不会好到哪里去,或达C么高峎ͼGoogle发展的很好,睇好它,本h也极情于googleQ更钟情于Java。如果拿癑ֺ与它比,googlel对是优势的。或怽讲我说话或思想q于偏激Q我会跟你讲Q难得偏Ȁ下……                                                         ?Jaunt

1997-2001Q微软与Sun的Java官司
                                                                                                               孟岩 / ?br />
Java 诞生?995q_正是微Y在Y件业地位达到巅峰的时代QWindows 95发布时的风光场面lh们留下的深刻印象至今隑ֿ。尽如此,作ؓ最卓越的技术领袖,比尔•盖茨仍然敏锐地注意到Java。当他了解了Java的一些细节之后,l予了这L评hQ?strong>Java是很长时间以来最优秀的程序设计语a
。”基于此Q微软于1996q?月申请ƈ获得了Java许可证。微软对?Java的这一热情态度在当时大大提高了Z对Java的兴和信心Q但也有不少人担心微软会依靠自己强大的媄响力在标准之外另立标准,从而破坏Java 的纯z性?br />
果然Q从1997q发布Visual J++的第一个版本开始,微Y开始在Java中掺入自qU有扩展。这毫无疑问引vSun的高度重视?997q?0月,Sun向美国加州地Ҏ院v诉微软公司违反两公司微软用Java技术所{֮的合同,指控微Y公司在自qJava产品中做了“不恰当的修改”,q反了合同中承诺向用h供Java 兼容产品的条ƾ。这一官司h持久Q直?001q?月双方达成和解,微Yl提供采用Sun开发的Java技术的现有产品Q包括测试版Q。不q, Sun有限制地仅对包括Java 1.1.4的微软品提供许可。到?001q?月,微Y公布新版的Windows XP不再支持Sun的JVMQƈ且推Z.NETq_与Java分庭抗礼?br />现在回过头去看,当时的这一场官司对Java世界产生了深q的影响。如果没有这一场官司,也许很多JavaE序员都在用Visual J++Q基于WFC开发Windows客户端程序,同时不得不面对被两个不同的事实标准所分裂的Java世界。?br />
Trackback:http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350819.aspx

Jaunt 2006-11-24 13:13 发表评论
]]>Java十大事g之三Q盟d位就此定Q{载)http://m.tkk7.com/jaunt/archive/2006/11/24/83222.htmlJauntJauntFri, 24 Nov 2006 04:48:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/24/83222.htmlhttp://m.tkk7.com/jaunt/comments/83222.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/24/83222.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83222.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83222.html本h看好JavaQ相信它的发展前景无限好?期待著,奋斗著…… ?Jaunt

1996QJava大跃q,盟主C此?br />                                                                                                            马伟 / ?br />Sun?996q一开始首先成立了JavaSoftl织Qƈ??3日正式发布自qJava 1.0Q作?0世纪业界出现的最重要的技术之一QJava引v了编E世界的革命。直到现在,Java仍然是互联网上最行的语a?br />
在Sun 正式发布Java 1.0之后QJavaq门新生的语a拥有了自己的会议——JavaOneQ这ơ会议初试啼韛_吸引?00多名参与者。除了拥有这么多的积极参与者来q行Java的开发之外,各大知名公司也纷U向Sun甌Java的许可。一旉QNetScape、惠普、IBM、Oralce、Sybase甚至当时刚推出Windows 95的微软都是Java的追随者?br />
Java的应用就像是世界上的玩家们组成的一个公开联盟Q告诉全世界我们大家是都在用着Java。也正是因ؓ如此QJava也找C自己的归ѝ现在的J2EE已经成ؓ中大型企业应用的标准,成ؓ承接数据库和Web之间的一个重要桥梁?br />
当年Java的机会实在太多了Q以至于很难知道到底该做什么。最lJava在应用服务器市场获得了难以取代的CQ也定了J2EE的发展方向,q且仍将延箋下去。?br />
Trackback:http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350806.aspx

Jaunt 2006-11-24 12:48 发表评论
]]>
Java十大事g之二QJava香浓世界Q{载)http://m.tkk7.com/jaunt/archive/2006/11/24/83210.htmlJauntJauntFri, 24 Nov 2006 04:12:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/24/83210.htmlhttp://m.tkk7.com/jaunt/comments/83210.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/24/83210.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83210.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83210.html本h觉得QJava像一杯咖啡,有一U好香,好特别的味道吸引著开发者,特别喜欢它有"只写一ơ,随处q行"Ҏ,管有h说它可能是由Sun公司掌控Q要跟著它发展方向走Q没有像C++没有受到M公司或谁的掌控与限制Q可以发挥自己最大优势,其实q不Ӟ学一门语aQ不对,不是学语aQ而是学一U思想(thinking)Q难道它(Sun)能掌控我们的思想吗?毫无疑问Q思想是我们自qQ问题是看你什么样的心态,什么样的思想去thinkingQ这样发挥出来的一股能量才是大的……   ?Jaunt

1995QJava香浓世界
                                                                                                            马伟 / ?br />1995 q_Sun正式对外公布了JavaQƈ且发布了JDK 1.0。这U外形酷似C++Q却包含一颗Smalltalk般纯z的面向对象之心的全新程序设计语a及其q_Q几乎在一夜之间就成ؓ软g产业的新宠儿?

Java当时仅仅被用来ؓ|站制作一些动态应用,诸如动画囄之类Q但q仍然引起了很多Web开发者们的注意,他们非常渴望有一U安全的语言Q可以在静态的HTML|页上制作动d片。Sun最l把Java集成到NetScape览器。同时因为它h“只写一ơ,随处q行”的Ҏ,而引起了很多开发者的注意Q他们可以再也不用ؓ了ɽE序能够在不同型Lg上运行而耗费大量的时间来~译代码了?br />
当时的Web览器的出现也ؓJava的出现vC很好的推动作用,通过Java和Web览器的l合Qh们似乎看C什么,有h甚至预言PC在一两年内退出历史的舞台Q取而代之的是基于Java的浏览器应用E序Q通过|络计算讑֤来进行应用。Java的出Cؓ当时的Y件业带来了无限的遐惟뀂?br />
Trackback:http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350792.aspx

Jaunt 2006-11-24 12:12 发表评论
]]>
Java十大事g之一QJava源vQ{载)http://m.tkk7.com/jaunt/archive/2006/11/24/83207.htmlJauntJauntFri, 24 Nov 2006 03:46:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/24/83207.htmlhttp://m.tkk7.com/jaunt/comments/83207.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/24/83207.html#Feedback0http://m.tkk7.com/jaunt/comments/commentRss/83207.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83207.html其实要学一门语aQ一U编E思想Q对于了解过ȝhQ发展是很有必要的,q关乎到一门语a的前景,同时把握好、清楚自q方向更ؓ之重要,像历史一P你没有去了解它的hQ发展就难以更好地学好现在,甚至未来…?/font>                        Jaunt

1990-1994QJava源v
                                                                                                               孟岩 / ?br />
LarryWall_优秀E序员应有的三个特点Q懒惰、急躁和傲慢。Java是诞生在一懒惰、急躁而傲慢的E序天才之中?br />
1990 q?2月,Sun的工E师Patrick Naughton被当时糟p的Sun C++工具折磨的快疯了。他大声抱怨,q威胁要dSun转投当时在Steve Jobs领导之下的NeXT公司。领导层Z留住他,l他一个机会,启动了一个叫做StealthQ秘密行动)的项目。随着James Gosling{h的加入,q个目更名为Green。其目标是用C++为嵌入式讑֤开发一U新的基q_技术,James Gosling本h负责开发一个SGML~辑器?br />
正如Z事后分析的那Pq位天才的程序员Q?br />太懒惰——所以没有把C++学好Q开发中C一头包Q?br />太急躁——所以不愿意停下来读读Scott Meyers的新书《Effective C++》;
太傲慢——所以轻易地军_开发一中新的编E语a?/font>

他把q种语言命名为C++++--Q意思是C++“加上一些好东西Q减M些坏东西”。显然这个糟p的名字不可能长命百岁,很快q种颇受同伴喜爱的小语言被命名ؓOak?br />
C1992q?月,Oak语言q同Green OS和一些应用程序一起发布在U做Start 7的小讑֤上,从而之有了第一ơ精彩的亮相。随后,Sun开了一家名为FirstPerson的公司,整个团队被{Udq家公司里研发机盒Q以投标时代华纳公司的一个项目。这帮天才被技术狂热所鼓舞Q开发出了一个高交互性的讑֤Q结果没惛_时代华纳公司和有U电视服务商q不愿意用户拥有那么大的控制权,从而在竞标之战中|l了SGI。Oak的锋芒之锐,竟然把客户都l吓懵了。Sun沮地关闭了FirstPersonQ召回了整个团队。事实证明,传统行业中那些脑满肥肠的保守M者是腐朽没落的。回去!回到Ȁ情澎湃的IT产业Q抓住互联网的大潮,q才是出路!

1994q_Oak被命名ؓJavaQ针对互联网的新一轮开发如火如|一切已l就l,熔岩在地下奔,火山卛_喷发?br />
Trackback: http://blog.csdn.net/programmer_editor/archive/2006/10/25/1350759.aspx

Jaunt 2006-11-24 11:46 发表评论
]]>
如何字W串或者数字{换成大写货币http://m.tkk7.com/jaunt/archive/2006/11/23/83087.htmlJauntJauntThu, 23 Nov 2006 09:51:00 GMThttp://m.tkk7.com/jaunt/archive/2006/11/23/83087.htmlhttp://m.tkk7.com/jaunt/comments/83087.htmlhttp://m.tkk7.com/jaunt/archive/2006/11/23/83087.html#Feedback1http://m.tkk7.com/jaunt/comments/commentRss/83087.htmlhttp://m.tkk7.com/jaunt/services/trackbacks/83087.html 今天去面试却遇到了这样一道题“如何将字符串或者数字{换成大写货币”,当时没有做出来,很气愤,于是在|上查涉及如何将字符串或者数字{换成大写货币的方法,l于扑և了如何做的方法^_^

主要功能Q?br />
1.   String convertToCapitalMoney(String moneyStr) 
      字W串转换成中文的大写货币?br />
2.   String convertToCapitalMoney(double moneyValue)
      数字{换成中文的大写货币?br />
文gQMoneyConvert.java

public class MoneyConvert {
     /*
      *  <p>Description: 字符串处理的公共c?lt;/p>
      *  <p>Copyright 2006 </p>
      *  @author  jaunt
      *  @Create Date : 2006-11-23
      */
   
     /*
      *  字W串转换成中文的大写货币?br />      *  @param   moneyStr
      *  @return
      */
    public static String convertToCapitalMoney(String moneyStr) {
     double money = 0;
     try {
      money = Double.parseDouble(moneyStr);
     }
     catch (Exception e) {
      
     }
     return convertToCapitalMoney(money);
    }
    /*
     *  数字{换成中文的大写货币?br />     *  @param   moneyValue
     *  @return
     */
    public static String convertToCapitalMoney(double moneyValue) {
     double money = moneyValue + 0.005;  //  防止点数四舍五入造成误差
     String Result = "";
     String capitalLetter = "零壹贰叁肆伍陆柒捌玖";
     String moneytaryUnit = "分角圆拾C万拾C亿拾C万拾C亿拾C";   
     String tempCapital, tempUnit;
     
     
     int integer;   //  q整数部分
     int point;     //  q数部分
     int tempValue; //  q每一位的?br />     integer = (int)money;
     point = (int)(100 * (money - (float)integer));
 
     if (integer == 0)
      Result = "零圆";
        /*
         *     货币整数部分操作
         *     1.    依次取得每一位上的?br />         *     2.    转换成大?br />         *     3.    定货币单位
        */
     for (int i = 1; integer > 0; i++) {
      tempValue = (integer % 10);   
      tempCapital = capitalLetter.substring(tempValue, tempValue + 1);    
      tempUnit = moneytaryUnit.substring(i + 1, i + 2);    
      Result = tempCapital + tempUnit + Result;   
      integer =  integer / 10;
     }
        /*
        *  货币数部分操作
        */
     tempValue = (point / 10); 
     for (int i = 1; i > -1; i--) {    
      tempCapital = capitalLetter.substring(tempValue, tempValue + 1);   
      tempUnit = moneytaryUnit.substring(i, i + 1);   
      Result = Result + tempCapital + tempUnit;   
      tempValue = point % 10;
     }
     return Result;
    }  
}

试代码Q?/font>

 public static void main(String[] args) {
 
     String money1 = MoneyConvert.convertToCapitalMoney("33333.214");
        System.out.println(money1);
        String money = MoneyConvert.convertToCapitalMoney(33333.214);
        System.out.println(money);
}

输出l果Q?br />
叁万?/font>?span id="Code_Open_Text_155609" style="DISPLAY: inline">?/font>?span id="Code_Open_Text_155609" style="DISPLAY: inline">?/font>?span id="Code_Open_Text_155609" style="DISPLAY: inline">叁圆?/span>?span id="Code_Open_Text_155343" style="DISPLAY: inline">?/span>?br />叁万?/font>?span id="Code_Open_Text_155609" style="DISPLAY: inline">?/font>?span id="Code_Open_Text_155609" style="DISPLAY: inline">?/font>?span id="Code_Open_Text_155609" style="DISPLAY: inline">叁圆?/span>?span id="Code_Open_Text_155343" style="DISPLAY: inline">?/span>?/font>

 



Jaunt 2006-11-23 17:51 发表评论
]]>
վ֩ģ壺 ˳վ߲| רһvav| ޸岻Ƶ| 鶹ƷѹƬ| ޹Ʒ˾Ʒ| պ߹ۿ| avַ| һһһƬѸ| Ƶ| avѴƬ߹ۿ| aרav| һëƬѿ| ޹˾þþƷapp| | ŷ޹SUV| AV벻߹ۿ| ˳ɴƬ߹ۿ| ޾Ʒ| þѹۿƷ88av| þĻƷѩ| ɫվ| aŹavۺav| ޹˾þۺ| 99ƷȫѹۿƵ..| ޹| ŮëƬѲƵm| ɫ˵| պƷרַ| 88avѹۿ| Ʒlvɫ| ޺ݺۺϾþþþ | ޹Ʒ߹ۿ97| Ұѹۿ| С˵ר޴ɫУ԰| lƷ߹ۿ| ĻĻmv| Ļ| һĻ| ȫëƬ߲| yellowƵѿ| Ƶ|