锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲一区在线视频,亚洲成年看片在线观看,亚洲欧洲国产成人综合在线观看 http://www.tkk7.com/alexwan/category/32011.htmlLet life be beautiful like summer flowers and death like autumn leaves.zh-cnWed, 26 Aug 2009 04:01:19 GMTWed, 26 Aug 2009 04:01:19 GMT60[j2ee]linux涓婣ctivemq鐨勯儴緗插拰浣跨敤http://www.tkk7.com/alexwan/archive/2009/05/06/269182.htmlAlexwanAlexwanWed, 06 May 2009 02:57:00 GMThttp://www.tkk7.com/alexwan/archive/2009/05/06/269182.htmlhttp://www.tkk7.com/alexwan/comments/269182.htmlhttp://www.tkk7.com/alexwan/archive/2009/05/06/269182.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/269182.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/269182.html http://activemq.apache.org/getting-started.html#GettingStarted-StartingActiveMQ

1.涓嬭澆
http://activemq.apache.org/download.html

2.瑙e帇
灝嗕笅杞戒笅鏉ョ殑apache-activemq-5.2.0-bin.tar.gz鏀劇疆浜?usr/local
cd /usr/local/
tar xvfz apache-activemq-5.2.0-bin.tar.gz
鍒橝ctiveMQ鐨勫畨瑁呯洰褰曚負錛?usr/local/apache-activemq-5.2.0

3.淇敼activemq榪愯鏂囦歡鐨勬潈闄?br /> cd /usr/local/apache-activemq-5.2.0/bin
chmod 755 activemq

4.榪愯
(1).鏅氬惎鍔?br /> bin/activemq
(2).鎸囧畾鏃ュ織鏂囦歡鐨勫惎鍔ㄦ柟寮?br /> bin/activemq >/tmp/smlog 2>&1 &
(3)鍚庡彴鍚姩鏂瑰紡
nohup bin/activemq >/tmp/smlog 2>&1 &

榪欓噷闇瑕佹敞鎰忥細鍓嶄袱縐嶅惎鍔ㄦ柟寮忓湪linix鍛戒護琛屾垨鑰呴氳繃ssh瀹㈡埛绔惎鍔ㄦ椂鍦ㄥ叧闂搴旂殑紿楀彛鏃禷ctivemq浼氬叧闂紝鐢氳嚦鐩存帴ctrl+c涔熶細瀵艱嚧activemq閫鍑猴紱絎笁縐嶅垯涓嶄細鍑虹幇榪欑鎯呭喌銆?br />
5.楠岃瘉鏈嶅姟绔槸鍚﹀紑鍚紝鏈夊嚑縐嶆柟娉?br /> (1).鏌ョ湅鎺у埗鍙拌緭鍑烘垨鑰呮棩蹇楁枃浠?br /> (2).鐩存帴璁塊棶activemq鐨勭鐞嗛〉闈細http://localhost:8161/admin/

6.鍏抽棴activemq
濡傛灉寮鍚柟寮忔槸浣跨敤(1)鎴?2)錛屽垯鐩存帴ctrl+c鎴栬呭叧闂搴旂殑緇堢鍗沖彲
濡傛灉寮鍚柟寮忔槸(3),鍒欑◢寰夯鐑︿竴鐐癸細
鍏堟煡鎵懼埌activemq瀵瑰簲鐨勮繘紼嬶細
ps -ef | grep activemq
鐒跺悗鎶婂搴旂殑榪涚▼鏉鎺夛紝鍋囪鎵懼埌鐨勮繘紼嬬紪鍙蜂負 168168
kill 168168





Alexwan 2009-05-06 10:57 鍙戣〃璇勮
]]>
鍏抽棴MyEclipse6.0.1鐨凲uick Update鐨勬柟娉?/title><link>http://www.tkk7.com/alexwan/archive/2009/03/16/259964.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Mon, 16 Mar 2009 03:13:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2009/03/16/259964.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/259964.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2009/03/16/259964.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/259964.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/259964.html</trackback:ping><description><![CDATA[Windows > Preferences > MyEclipse > Community Essentials, <br /> 鎶婇夐」 "Search for new features on startup"鐨勫墠鍕懼幓鎺夊嵆鍙? <br /> <img src ="http://www.tkk7.com/alexwan/aggbug/259964.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2009-03-16 11:13 <a href="http://www.tkk7.com/alexwan/archive/2009/03/16/259964.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[cxf]CXF瀹㈡埛绔厤緗枃浠朵箣鍖呭惈鏂囦歡http://www.tkk7.com/alexwan/archive/2009/02/18/255275.htmlAlexwanAlexwanWed, 18 Feb 2009 07:03:00 GMThttp://www.tkk7.com/alexwan/archive/2009/02/18/255275.htmlhttp://www.tkk7.com/alexwan/comments/255275.htmlhttp://www.tkk7.com/alexwan/archive/2009/02/18/255275.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/255275.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/255275.html涓繪棬錛?/font>

鍦–XF鏈嶅姟绔厤緗甒EB SERVICE鏃訛紝閫氬父浼氬寘鍚竴浜涙潵姝xf.jar閲岄潰鐨刋ML鏂囦歡錛岀敤浜庤嚜鍔ㄩ厤緗渶瑕佷嬌鐢ㄥ埌鐨凚EAN

渚嬪錛?/p>

1<import resource="classpath:META-INF/cxf/cxf.xml" />   
2<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />   
3<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />   

浣嗘槸鍦ㄥ鎴風閰嶇疆鐨勬椂鍊欒繖浜涙枃浠舵槸涓嶉渶瑕佺殑錛岀敋鑷抽厤緗細寮曞彂閿欒錛岃緇嗙殑緇忚繃瑙佷笅鏂囥?/p>

緇忚繃錛?/font>

浠婂ぉ鍦ㄩ厤緗鎴風鐨勬椂鍊欙紝姝ラ鍜屽唴瀹歸兘鏄拰寰甯鎬竴鏍風殑錛屼絾鏄?/p>

鍑虹幇涓涓狽ullPointerException 鐨勯敊璇紝鍙煡閬撹繖涓敊璇槸鍦ㄥ垱寤哄鎴風service鐨勬椂鍊欏嚭鐨勯敊錛屼絾鏄師鍥犳壘涓嶅埌銆?/p>

閿欒鍫嗘爤錛?/p>

Caused by: java.lang.NullPointerException    
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:
160)    
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:
102)    
    at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:
51)    
    at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:
97)    
    at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:
89)    
    at com.itravel.cxf.client.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:
25)    
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)    
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)    
    at java.lang.reflect.Method.invoke(Method.java:
585)    
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:
115)   

鐩村埌鍚庢潵鎴戝崟鐙姞杞戒簡鍒涘緩瀹㈡埛绔痵ervice鐨刟pplicationContext鏃訛紝鍒濆鍖栨槸姝e父鐨勶紝鎵浠ュ氨鎬鐤戦厤緗枃浠跺嚭浜嗛棶棰橈紱

褰撲笂闈㈡彁鍒扮殑鍑犱釜琚寘鍚繘鏉ョ殑鏂囦歡鐨勯厤緗鍒犻櫎鍚庯紝涓鍒囧氨姝e父浜嗐?/p>

Alexwan 2009-02-18 15:03 鍙戣〃璇勮
]]>
銆怶eb Harvest銆慦eb harvest鑾峰彇XML鍑虹幇涔辯爜鐨勮В鍐沖姙娉?http://www.tkk7.com/alexwan/archive/2009/02/17/255102.htmlAlexwanAlexwanTue, 17 Feb 2009 07:13:00 GMThttp://www.tkk7.com/alexwan/archive/2009/02/17/255102.htmlhttp://www.tkk7.com/alexwan/comments/255102.htmlhttp://www.tkk7.com/alexwan/archive/2009/02/17/255102.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/255102.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/255102.htmlWeb harvest鑾峰彇XML鍑虹幇涔辯爜鐨勮В鍐沖姙娉曪細

鐜拌薄錛?/p>

鍦╓eb harvest涓嬌鐢╤ttp璇鋒眰鍘昏幏鍙栨煇涓繙紼嬬殑XML錛屾XML鐨勭壒寰佹槸鏃犳枃浠跺ご(鍗蟲病鏈夌紪鐮佹弿榪扮瓑鍏抽敭淇℃伅)錛岄噰鐢ㄤ簡澶氱鍔炴硶鍘昏幏鍙栵紝鍑虹幇涔辯爜錛屾棤娉曡В鏋愭垚鎴戜滑闇瑕佺殑鏁版嵁銆?/p>

鍔炴硶錛?/p>

(1)鏈鍘熷鍔炴硶錛?/font>浣跨敤Java涓殑URLConnection錛孖nputStream絳夌被璇誨彇瀛楄妭嫻侊紝鏋勯犲瓧絎︿覆錛?/p>

Java浠g爜
  1. /**  
  2.              * 閫氳繃URL鑾峰彇XML,鍥犱負鍦╓eb harvest鑾峰彇XML鏃舵棤娉曡幏鍙栨甯哥紪鐮佺殑XML  
  3.              */  
  4.             URL url=new URL(link);   
  5.             URLConnection connection=url.openConnection();   
  6.             InputStream in=connection.getInputStream();   
  7.             ListbyteList=new ArrayList();   
  8.             byte b=-1;   
  9.             while((b=(byte)in.read())!=-1)   
  10.             {   
  11.                 byteList.add(b);   
  12.             }   
  13.             byte[]bytes=new byte[byteList.size()];   
  14.             for(int i=0;i
  15.             {   
  16.                 bytes[i]=byteList.get(i);   
  17.             }   
  18.             /**  
  19.              * 杈撳嚭鏃ュ織紜鍏剁紪鐮? 
  20.              */  
  21.             logger.debug(new String(bytes));   
  22.             logger.debug(new String(bytes,"utf-8"));   
  23.             logger.debug(new String(bytes,"gbk"));   
  24.             logger.debug(new String(bytes,"gb2312"));  

 

 (2)鏈濂界殑鍔炴硶錛?/font>鐩存帴浣跨敤dom4j涓殑SAXReader

Java浠g爜
  1. /**  
  2.              * 閫氳繃URL鑾峰彇XML,鍥犱負鍦╓eb harvest鑾峰彇XML鏃舵棤娉曡幏鍙栨甯哥紪鐮佺殑XML  
  3.              */  
  4.             URL url=new URL(link);   
  5.             SAXReader xmlReader = new SAXReader();   
  6.             Document doc=xmlReader.read(url);  

闈炲父綆鍗曪紝榪炵紪鐮侀兘涓嶇敤綆★紒

 

 鍏朵腑錛歭ink涓洪渶瑕佽幏鍙朮ML鐨勫湴鍧



Alexwan 2009-02-17 15:13 鍙戣〃璇勮
]]>
[CXF]CXF涓嬬殑淇濇姢鏆撮湶鍦ㄥ鐨剋eb service鐨勬柟娉曞強娉ㄦ剰浜嬮」http://www.tkk7.com/alexwan/archive/2009/02/17/255049.htmlAlexwanAlexwanTue, 17 Feb 2009 03:31:00 GMThttp://www.tkk7.com/alexwan/archive/2009/02/17/255049.htmlhttp://www.tkk7.com/alexwan/comments/255049.htmlhttp://www.tkk7.com/alexwan/archive/2009/02/17/255049.html#Feedback3http://www.tkk7.com/alexwan/comments/commentRss/255049.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/255049.htmlCXF涓嬬殑淇濇姢鏆撮湶鍦ㄥ鐨剋eb service鐨勬柟娉曞強娉ㄦ剰浜嬮」

鏈榪戣繖鍑犲ぉ閮藉湪浣跨敤CXF浣滀負webservice鐨勭粍浠訛紝璇曞浘灝嗗叕寮鐨剋ebservice鍔犲叆鍒頒繚鎶ょ殑鑼冨洿鍐呫?/p>

娣誨姞鍒頒繚鎶ょ殑鏂規硶鏈変笁縐嶏細

(1)鎸囧畾鍦板潃璁塊棶錛屽嵆鎸囧畾涓浜汭P鍦板潃錛屽彧鏈夎繖浜涘湴鍧鐨勮姹傛垜浠殑鎺ュ彛鎵嶅鐞嗐?/font>

榪欑鏂規硶鎴戝湪寮鍙戜腑鏈変嬌鐢ㄥ埌錛屽彲浠ラ氳繃WEB瀹瑰櫒涓殑Filter綾繪潵瀹炵幇錛?/p>

鍙渶瑕佹鏌ヨ姹傜殑鍦板潃鏄惁鍦ㄦ垜浠寚瀹氱殑鍦板潃鍒楄〃涓氨鍙互浜嗐?/p>

浼樼偣:澶勪簬璇鋒眰鍝嶅簲閾劇殑鍓嶇錛屽搷搴旈潪甯歌繀閫燂紝鎵浠ユ秷鑰楃殑璧勬簮寰堝皯銆?/p>

緙虹錛?/font>浣跨敤榪欑鏂規硶鍙兘媯鏌ユ寚瀹氬湴鍧鐨勮姹傦紝閫氬父鍙兘搴旂敤鐨勫皬鑼冨洿鍐咃紝濡傚眬鍩熺綉銆?/p>

鍙﹀浣跨敤榪欑楠岃瘉鏂規硶錛屾棤娉曡繘琛屾潈闄愮殑媯鏌ワ紝涓鏃﹂氳繃楠岃瘉灝嗗彲浠ユ墽琛屾墍鏈夊叕寮鐨勬帴鍙c?/p>

(2)鐢ㄦ埛鍚?瀵嗙爜瀵歸獙璇侊紝浣跨敤鎸囧畾鐨勭敤鎴峰悕瀵嗙爜榪涜楠岃瘉

榪欑鏂規硶閫傚悎浜庡叿浣撶敤鎴風殑媯鏌ワ紝榪涜屽彲浠ユ鏌ュ叾鏄惁鏈夋潈闄愭墽琛屽叾璇鋒眰鐨勬搷浣?

浼樼偣錛?/span>鍙互鍙噯紜湴媯鏌ョ敤鎴鳳紝鐢氳嚦楠岃瘉鏉冮檺銆?/p>

緙虹偣錛?/span>榪欑鏂瑰紡涓嶈兘鍜學EB搴旂敤鐨勭櫥褰曚竴鏍鳳紝鍙渶瑕侀獙璇佷竴嬈″氨鍙互浜嗭紱蹇呴』

姣忎釜璇鋒眰閮芥鏌ワ紝濡傛灉闇瑕佷嬌鐢ㄨ繖縐嶆柟娉曞幓鍋氾紝榪橀渶瑕佸鐞嗗ソ綾諱技鐧誨綍/閫鍑烘満鍒躲?/p>

(3)浣跨敤HTTPS榪涜楠岃瘉錛岃繖縐嶆柟娉曞簲璇ヤ篃鍙互鍏蜂綋鐨勯獙璇佽瘉涔︽潵鑷摢涓敤鎴鳳紝榪涜屾鏌ュ叾鏉冮檺銆?/font>

浼樼偣錛?/font>瀹夊叏鏇存湁淇濊瘉

緙虹偣錛?/font>閰嶇疆澶嶆潅錛屽瀹㈡埛绔▼搴忓憳瑕佹眰寰堟瘮杈冮珮銆?/p>

 

娉ㄦ剰浜嬮」錛?/font>

浣跨敤CXF榪涜WEBService浜や簰鏃訛紝鐗瑰埆鏄繘琛屽鎴風宸ヤ綔鏃訛紝鏈濂藉皢鏈嶅姟绔拰瀹㈡埛绔殑鐜鍓ョ寮鏉ャ?/p>

榪欏嚑澶╃殑宸ヤ綔鏁欎細浜嗘垜榪欎釜浜嬫儏(浠婂ぉ涓婂崍鍦ㄦ祴璇曞鎴風浠g爜鏃跺嚭鐜拌帿鍚嶅叾濡欑殑閿欙紝鏈鍚庡彂鐜版槸JAR鍖呭啿紿侊紝

鍦ㄦ湇鍔″櫒鐨勭幆澧冧腑榪愯瀹㈡埛绔▼搴忔椂錛岀▼搴忓姞杞戒簡榪囨椂鐨凧AR)銆?/p>

Alexwan 2009-02-17 11:31 鍙戣〃璇勮
]]>
[鐖櫕]緗戦〉鍒嗘瀽鐨勫獎鍝嶅洜绱犱箣涓撲笟鍖栫▼搴?/title><link>http://www.tkk7.com/alexwan/archive/2009/02/17/255038.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Tue, 17 Feb 2009 03:01:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2009/02/17/255038.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/255038.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2009/02/17/255038.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/255038.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/255038.html</trackback:ping><description><![CDATA[<p>鍦ㄧ埇铏鍩熺殑緗戦〉鍒嗘瀽鐨勮繃紼嬩腑錛岀埇铏▼搴忕殑澶嶆潅搴﹀緢澶х▼搴︿笂鍙楃洰鏍囩綉绔欑殑涓撲笟鍖栫▼搴﹀獎鍝嶃?/p> <p>鍏跺獎鍝嶄富瑕佽〃鐜板湪涓ゆ柟闈細</p> <p>(1)瀵規祦紼嬬‘瀹氳繃紼嬬殑褰卞搷</p> <p>鍦ㄩ氳繃鍒嗘瀽緗戠珯鍦板浘鐨勬柟寮忓幓紜畾嫻佺▼錛屽涓撲笟鍖栫▼搴︿笉鏄偅涔堥珮鐨勭綉绔欒岃█錛屽叾緗戠珯鍒嗙被銆佸垪琛ㄦ柟寮忓熀鏈熀鏈兘閲囩敤閾炬帴鐨勬柟寮忥紝榪欐牱鍦ㄦ祦紼嬪疄鐜版槸寰堝鏄撳氨鍙幏鍙栭渶瑕佺殑閾炬帴錛涜屽涓撲笟鍖栫▼搴﹁緝楂樼殑緗戠珯鑰岃█錛屽湪鍒嗙被涓嬪線寰閫氳繃鎼滅儲銆乯avascript(鍖呮嫭AJAX)緲婚〉鐨勬柟寮忔潵闄堝垪鍚岀被璁板綍錛岃繖鍦ㄦ祦紼嬪疄鐜扮殑鏃跺欙紝灝遍渶瑕佺▼搴忓憳鍘誨垎鏋愪竴浜沯avascript鍑芥暟鎵鍋氱殑鎿嶄綔錛屽幓鐚滃害鐩稿叧鍒楄〃鏂瑰紡鐨刄RL(濡傛悳绱㈢殑琛ㄥ崟濡備綍鎻愪氦銆佺炕欏靛嚱鏁板浣曞鐞嗙炕欏電瓑)銆?/p> <p>(2)瀵硅幏鍙栬緇嗕俊鎭繃紼嬬殑褰卞搷</p> <p>鍦ㄨ幏鍙栬緇嗕俊鎭殑鏃跺欙紝鍩烘湰閮芥槸閫氳繃鍒嗗績璇︾粏淇℃伅欏甸潰鐨勭粨鏋勫嚭鍙戠殑銆?/p> <p>瀵逛笓涓氬寲紼嬪害楂樼殑緗戠珯鑰岃█錛岃緇嗕俊鎭〉闈㈢殑鐨勫埗浣滀篃鏄姇鍏ヤ簡涓浜涚簿鍔涚殑錛岄氬父閮借瀹氬拰欏甸潰鐗瑰畾鐨勪綅緗樉紺虹壒瀹氱殑淇℃伅錛岃繖鏍峰氨渚夸簬鍦ㄥ垎鏋愯繃紼嬩腑鑾峰彇鎸囧畾鐨勬暟鎹?/p> <p>鑰屽涓撲笟鍖栫▼搴︾◢浣庣殑緗戠珯鑰岃█錛岃緇嗛〉闈㈢殑鍐呭寰堝閮芥槸鐢℉TML緙栬緫鍣ㄧ洿鎺ョ紪杈戝嚭鏉ョ殑鍐呭錛屽湪鍚屼竴棰戦亾鐨勪笉鍚屽垎綾葷殑璇︾粏淇℃伅欏甸潰涓瓨鍦ㄧ潃寰堝ぇ鐨勫樊寮傦紝榪欎嬌寰楄幏鍙栬緇嗕俊鎭儴鍒嗙殑鍒嗘瀽紼嬪簭澶嶆潅搴﹀嶅銆?/p> <p> </p> <p>涓漢鐨勭編濂芥効鏈涳細瀹佹効鍒嗘瀽鐨勬槸涓撲笟鍖栫▼搴﹂珮涓鐐圭殑绔欑偣錛屽洜涓烘祦紼嬬殑紜畾鍙婂叿浣撳疄鐜版繪槸鍙互鎯沖埌鍔炴硶瑙e喅鐨勶紱璇︾粏淇℃伅鐨勫垎鏋愬瓨鍦ㄥお澶氶〉闈㈢粨鏋勭殑璇濓紝灝嗗湪鑾峰彇璇︾粏淇℃伅浠樺嚭澶ぇ浠d環錛?/p> <img src ="http://www.tkk7.com/alexwan/aggbug/255038.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2009-02-17 11:01 <a href="http://www.tkk7.com/alexwan/archive/2009/02/17/255038.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[linux]linux涓嬬殑鑴氭湰涓巎ava涓殑鐩稿璺緞http://www.tkk7.com/alexwan/archive/2008/12/12/246000.htmlAlexwanAlexwanFri, 12 Dec 2008 09:31:00 GMThttp://www.tkk7.com/alexwan/archive/2008/12/12/246000.htmlhttp://www.tkk7.com/alexwan/comments/246000.htmlhttp://www.tkk7.com/alexwan/archive/2008/12/12/246000.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/246000.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/246000.html鑳屾櫙錛?/strong>
linux浣跨敤ANT緙栬瘧java綾誨茍閮ㄧ講鍒癟omcat涓嬶紝鐒跺悗浣跨敤鑴氭湰(deploy.sh)寮鍚疶omcat,鑴氭湰濡備笅:
deploy.sh(鍏剁粷瀵硅礬寰勪負錛?usr/local/myapp/deploy.sh)

1/usr/local/apache-tomcat-5.5.20/bin/shutdown.sh
2ant
3/usr/local/apache-tomcat-5.5.20/bin/startup.sh
4
鍏朵腑鍚勮鐨勬剰涔夛細
(1)鍏抽棴tomcat
(2)緙栬瘧java綾誨茍閮ㄧ講鍒皌omcat
(3)寮鍚痶omcat
榪欓噷浣跨敤鐨勫懡浠ら兘鏄粷瀵硅礬寰勮繍琛岀殑銆?br />
闂鏉ヤ簡錛?/strong>
(1)鍦ㄩ」鐩腑瀹夋帓浜唋og4j鐨勬棩蹇楄緭鍑哄埌myapp.log,鍏惰礬寰勫啓娉曪細../log/myapp.log;鍚姩鏈嶅姟鍣ㄧ殑鏃跺欏湪catalina.out涓緭鍑洪敊璇俊鎭紝璇?./log/myapp.log娌℃湁鎵懼埌銆?br /> (2)鍦ㄧ▼搴忎腑浣跨敤浜唎utput/files/錛岀▼搴忓畬鎴愬悗寰堥毦鎵嶆壘鍒版枃浠訛紝鍥犱負鍏朵綅緗茍涓嶅儚鍦╳indow涓嬭皟璇曟椂涓鏍鳳紝鏈鍚庝嬌鐢?find   -name   output -type   d鍛戒護鎵嶆壘鍒幫紝鍙戠幇鍘熸潵榪欎釜鏂囦歡澶規墍鍦ㄧ殑浣嶇疆灝辨槸鍦細/usr/local/myapp/涓嬮潰銆?br />
鍊鍒濈幇錛?/strong>
鍙錛屼嬌鐢ㄨ剼鏈紑鍚痶omcat鏃跺鏋滀互緇濆璺緞鐨勬柟寮忓幓寮鍚殑璇濓紝閭d箞鍦ㄧ▼搴忎腑鐨勭浉瀵硅礬寰勫氨浼氫互鑴氭湰鐨勫綋鍓嶇洰褰曚綔涓鴻礬寰勭殑璧峰鐐廣傝繖鏍峰氨瀵艱嚧浜嗗湪鏂囦歡鐨勪綅緗笂鍑虹幇鍙樺寲錛屼嬌寰楁枃浠剁鐞嗗嚭鐜板洶闅劇敋鑷沖宸叉湁鐨勬枃浠墮犳垚鐮村潖銆?br />
闂瑙e喅錛?br /> 瑙e喅璺緞鐨勯棶棰樻湁寰堝錛屽湪榪欓噷涓昏璇翠竴涓嬩互涓嬩袱涓濊礬錛?br /> (1)浣跨敤鍙厤緗殑緇濆璺緞錛屽湪ANT閮ㄧ講鐨勬椂鍊欙紝鍙互灝哤indow涓嬬殑璺緞鏇挎崲鎴怢inux涓嬬殑緇濆璺緞錛岃繖鏍峰氨寰堟柟渚跨鐞嗭紝姝や負涓婄瓥銆?br /> (2)浣跨敤鐩稿璺緞鏃訛紝寮鍚疶omcat鏃朵竴瀹氳鍒囨崲鍒皌omcat鐨刡in鏂囦歡澶瑰紑鍚紝榪欐牱鐩稿璺緞鎸囧悜鐨勪綅緗氨鍜學indow涓嬬殑涓鑷翠簡錛屾涓轟笅絳栦篃銆?br /> 浣跨敤鐩稿璺緞鐨勮剼鏈涓嬶細
1/usr/local/apache-tomcat-5.5.20/bin/shutdown.sh
2ant
3cd /usr/local/apache-tomcat-5.5.20/bin/
4./startup.sh
鍏朵腑鍚勮鐨勪綔鐢細
(1)鍏抽棴tomcat
(2)緙栬瘧java綾誨茍閮ㄧ講鏂囦歡
(3)鍒囨崲鐩綍鍒皌omcat鐨刡in鏂囦歡澶?br /> (4)寮鍚痶omcat


浼拌鍏朵粬搴旂敤鏈嶅姟鍣ㄤ笅浣跨敤鑴氭湰鍜岀浉瀵硅礬寰勪篃鏃朵篃浼氶亣鍒頒竴鏍風殑闂錛屾柟娉曚及璁′篃鏄被浼肩殑銆?br />


Alexwan 2008-12-12 17:31 鍙戣〃璇勮
]]>
[freemarcker]Expression JspTaglibs is undefined鐨勮В鍐沖姙娉?/title><link>http://www.tkk7.com/alexwan/archive/2008/10/23/236194.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Thu, 23 Oct 2008 08:02:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/10/23/236194.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/236194.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/10/23/236194.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/236194.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/236194.html</trackback:ping><description><![CDATA[     鎽樿: Expression JspTaglibs is undefined鐨勮В鍐沖姙娉?nbsp; <a href='http://www.tkk7.com/alexwan/archive/2008/10/23/236194.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/alexwan/aggbug/236194.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-10-23 16:02 <a href="http://www.tkk7.com/alexwan/archive/2008/10/23/236194.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[eclipse]eclipse svn鏇存崲甯愬彿鐨勬柟娉?/title><link>http://www.tkk7.com/alexwan/archive/2008/10/16/234721.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Thu, 16 Oct 2008 08:53:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/10/16/234721.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/234721.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/10/16/234721.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/234721.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/234721.html</trackback:ping><description><![CDATA[     鎽樿: 鐢變簬鍦╯vn鐨勭晫闈腑騫舵病鏈変負鎴戜滑鎻愪緵鐩存帴鏇存崲鐢ㄦ埛鍚嶅瘑鐮佺殑鍦版柟錛屾墍浠ヤ竴鏃︽垜浠渶瑕佹洿鎹㈢敤鎴峰悕鐨勫氨闇瑕佽嚜宸辨兂涓浜涘姙娉曘?<br>  <a href='http://www.tkk7.com/alexwan/archive/2008/10/16/234721.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/alexwan/aggbug/234721.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-10-16 16:53 <a href="http://www.tkk7.com/alexwan/archive/2008/10/16/234721.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[linux]linux涓嬮泦鎴恆pache鍜宼omcat鏃跺彲鑳界敤鍒扮殑鍛戒護http://www.tkk7.com/alexwan/archive/2008/10/05/232423.htmlAlexwanAlexwanSat, 04 Oct 2008 16:10:00 GMThttp://www.tkk7.com/alexwan/archive/2008/10/05/232423.htmlhttp://www.tkk7.com/alexwan/comments/232423.htmlhttp://www.tkk7.com/alexwan/archive/2008/10/05/232423.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/232423.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/232423.html         鍦╝pache2鍜宼omcat5闆嗘垚鐨勭幆澧冧笅錛岄氬父浼氭妸闈欐佹枃浠訛紙濡俿html鏂囦歡錛夊瓨鏀懼湪apache鐨勭洰褰曚笅錛岃屽姩鎬佹枃浠跺垯瀛樺湪鍦╰omcat鐨勭杈栬寖鍥村唴錛屽洜涓哄紑鍙戣繃紼嬩腑騫舵病鏈夊皢榪欎袱綾繪枃浠跺垎寮錛屾墍浠ュ湪璁塊棶闈欐佹枃浠舵槸灝遍渶瑕佸仛涓槧灝勩?br />
        鍋囪闆嗘垚鐜涓紝瑁呮湁apache2鐨勬満鍣ㄥ湪灞鍩熺綉涓殑鍦板潃涓?92.168.1.55錛屼笅闈㈢畝縐?5錛涜鏈塼omcat5鐨勬満鍣ㄧ殑鍦板潃涓?92.168.1.66錛屽悗闈㈢畝縐?6
閭d箞鍦?5涓渶瑕佹彁渚涚殑鏄疦FS鏈嶅姟錛?br />
鍦?etc/exports涓坊鍔犲涓嬭鍙ワ細

{apache2_home}/htdocs     192.168.1.*(ro,no_root_squash)

鍏朵腑
{apache2_home}/鏄寚apache2鐨勫畨瑁呯洰褰曪紱
192.168.1.*鏄寚鍙闂殑鍩?br /> ro閫夐」鏄寚璁塊棶鐨勬潈闄?br /> no_root_squash閫夐」鏄寚55鐨剅oot鍦ㄨ繖涓枃浠跺す涓嬫病鏈夊啓鐨勬潈闄?br />


寮鍚疦FS鏈嶅姟鐨勫懡浠わ細

service nfs start

鐒跺悗鍦?6涓繍琛屽彟澶栦竴涓懡浠わ細

mount -o nolock 192.168.1.55:{apache2_home}/htdocs {tomcat_home}/webapps/ROOT


PS:濡傛灉淇敼浜?etc/exports鐨勮瘽闇瑕侀噸鏂板紑鍚痭fs鏈嶅姟錛岄偅涔堝叧闂殑鍛戒護鏄細service nfs stop銆?br />

Alexwan 2008-10-05 00:10 鍙戣〃璇勮
]]>
[Tomcat]linux涓嬫敼鍙榯omcat5.5鐨勫唴瀛樿緗?/title><link>http://www.tkk7.com/alexwan/archive/2008/09/12/228537.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Fri, 12 Sep 2008 02:58:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/09/12/228537.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/228537.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/09/12/228537.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/228537.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/228537.html</trackback:ping><description><![CDATA[鎵撳紑鍦═omcat鐨勫畨瑁呯洰褰曠殑bin鏂囦歡鐨刢atalina.sh鏂囦歡,榪涘叆緙栬緫鐘舵?<br /> 鍦ㄦ敞閲婂悗闈㈠姞涓婂涓嬭剼鏈?<br /> JAVA_OPTS='-Xms512m -Xmx1024m'<br /> JAVA_OPTS="$JAVA_OPTS -server -XX:PermSize=64M -XX:MaxPermSize=256m"<br /> <br /> 鍏朵腑 JAVA_OPTS='-Xms512m -Xmx1024m' 鏄緗甌omcat浣跨敤鐨勫唴瀛樼殑澶у皬.<br /> <br /> -XX:PermSize=64M -XX:MaxPermSize=256m 鎸囧畾綾葷┖闂?鐢ㄤ簬鍔犺澆綾?鐨勫唴瀛樺ぇ灝? <img src ="http://www.tkk7.com/alexwan/aggbug/228537.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-09-12 10:58 <a href="http://www.tkk7.com/alexwan/archive/2008/09/12/228537.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[CXF]Spring涓嬭緗瓹XF鐨刉ebService瀹㈡埛绔秴鏃舵椂闀?/title><link>http://www.tkk7.com/alexwan/archive/2008/09/04/227009.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Thu, 04 Sep 2008 08:45:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/09/04/227009.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/227009.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/09/04/227009.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/227009.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/227009.html</trackback:ping><description><![CDATA[<strong>鑳屾櫙</strong>:<br /> 鍦ㄤ嬌鐢╓ebService鐨勬椂鍊?鎴戜滑鍙兘闇瑕佷竴涓浠界殑WebService鏈嶅姟鍣?涓鏃︿富鏈嶅姟鍣╠own浜?鎴戜滑鍙互浣跨敤澶囦喚鐨勬湇鍔″櫒.閭d箞榪欓噷灝遍渶瑕佸瀹㈡湇绔繛鎺ユ湇鍔″櫒鐨勬椂闂村仛涓涓慨鏀?<br /> <br /> 鍦⊿pring+CXF鐨刉ebService鐜涓?瀹㈡埛绔湁涓や釜鏃墮棿灞炴ф槸鍙厤緗殑,鍒嗗埆鏄疌onnectionTimeout鍜孯eceiveTimeout.<br /> ConnectionTimeout--WebService浠CP榪炴帴涓哄熀紜,榪欎釜灞炴у彲浠ョ悊瑙d負tcp鐨勬彙鎵嬫椂鐨勬椂闂磋緗?瓚呰繃璁劇疆鐨勬椂闂撮暱鍒欒涓烘槸榪炴帴瓚呮椂.浠ユ縐掍負鍗曚綅,榛樿鏄?0000姣,鍗?0縐?<br /> <br /> ReceiveTimeout -- 榪欎釜灞炴ф槸鍙戦乄ebService鐨勮姹傚悗絳夊緟鍝嶅簲鐨勬椂闂?瓚呰繃璁劇疆鐨勬椂闀垮氨璁や負鏄搷搴旇秴鏃?浠ユ縐掍負鍗曚綅,榛樿鏄?0000姣,鍗?0縐?<br /> <br /> <br /> <strong>璁劇疆鐨勪緥瀛?/strong>:<br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080"> 1</span><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000ff">?></span><span style="color: #000000"><br /> </span><span style="color: #008080"> 2</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">beans </span><span style="color: #ff0000">xmlns</span><span style="color: #0000ff">="http://www.springframework.org/schema/beans"</span><span style="color: #ff0000"><br /> </span><span style="color: #008080"> 3</span><span style="color: #ff0000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xmlns:xsi</span><span style="color: #0000ff">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #ff0000"><br /> </span><span style="color: #008080"> 4</span><span style="color: #ff0000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xmlns:jee</span><span style="color: #0000ff">="http://www.springframework.org/schema/jee"</span><span style="color: #ff0000"><br /> </span><span style="color: #008080"> 5</span><span style="color: #ff0000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xmlns:jaxws</span><span style="color: #0000ff">="http://cxf.apache.org/jaxws"</span><span style="color: #ff0000"><br /> </span><span style="color: #008080"> 6</span><span style="color: #ff0000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xmlns:http-conf</span><span style="color: #0000ff">="http://cxf.apache.org/transports/http/configuration"</span><span style="color: #ff0000"> <br /> </span><span style="color: #008080"> 7</span><span style="color: #ff0000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xsi:schemaLocation</span><span style="color: #0000ff">="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd<br /> </span><span style="color: #008080"> 8</span><span style="color: #0000ff"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />           http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd<br /> </span><span style="color: #008080"> 9</span><span style="color: #0000ff"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />           http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd<br /> </span><span style="color: #008080">10</span><span style="color: #0000ff"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />           http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd "</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> </span><span style="color: #008080">11</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">http-conf:conduit </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="{http://impl.service.product.super.com/}ProjectService.http-conduit"</span><span style="color: #0000ff">></span><span style="color: #000000"> <br /> </span><span style="color: #008080">12</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">http-conf:client </span><span style="color: #ff0000">ConnectionTimeout</span><span style="color: #0000ff">="10000"</span><span style="color: #ff0000"> ReceiveTimeout</span><span style="color: #0000ff">="20000"</span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> </span><span style="color: #008080">13</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">http-conf:conduit</span><span style="color: #0000ff">></span><span style="color: #000000"> <br /> </span><span style="color: #008080">14</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">beans</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> </span><span style="color: #008080">15</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> <p> </p> <p><strong>榪欓噷闇瑕佹敞鎰忕殑鏈夊嚑涓湴鏂?/strong>:<br /> 1:闇瑕佹寚瀹歨ttp-conf鍚嶇О絀洪棿 xmlns:http-conf=<a >http://cxf.apache.org/transports/http/configuration</a><br /> 2:鎸囧畾妯″紡浣嶇疆: http://cxf.apache.org/transports/http/configuration <a >http://cxf.apache.org/schemas/configuration/http-conf.xsd</a><br /> 3:http-conf:conduit涓殑name灞炴?鎸囧畾璁劇疆鐢熸晥鐨勬湇鍔?濡備緥瀛愪腑,鍙鏈嶅姟鍚嶄負{http://impl.service.product.sww.com/}ProjectService鐨勬湇鍔$敓鏁?<br /> 浣跨敤涓嬮潰鐨勮緗垯浼氬鎵鏈夋湇鍔$敓鏁?br /> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><</span><span style="color: #800000">http-conf:conduit </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="*.http-conduit"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />      <img alt="" src="http://www.tkk7.com/Images/dot.gif" /><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">http-conf:conduit</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> <p><br /> 鏇磋緇嗙殑閰嶇疆璇峰弬鑰僀XF瀹樻柟鏂囨。:<br /> <br /> <a title="http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html" >http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html</a><br /> </p> <p> </p> <img src ="http://www.tkk7.com/alexwan/aggbug/227009.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-09-04 16:45 <a href="http://www.tkk7.com/alexwan/archive/2008/09/04/227009.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[J2EE]涓浜涗笉閿欑殑鏂囩珷http://www.tkk7.com/alexwan/archive/2008/09/03/226602.htmlAlexwanAlexwanWed, 03 Sep 2008 03:12:00 GMThttp://www.tkk7.com/alexwan/archive/2008/09/03/226602.htmlhttp://www.tkk7.com/alexwan/comments/226602.htmlhttp://www.tkk7.com/alexwan/archive/2008/09/03/226602.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/226602.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/226602.html 鏀墮泦涓浜涘ソ鏂囩珷鐨勯摼鎺?涓轟簡鏂逛究鑰屽凡.

鏈鍚庢洿鏂版椂闂?:2008-09-03



閰嶇疆綾?

杞繪澗瀹炵幇Apache,Tomcat闆嗙兢鍜岃礋杞藉潎琛?/a>

java涓殑璺緞闂

鏁版嵁搴撶被:

oracle 鍒嗗尯琛ㄧ殑寤虹珛鏂規硶

鍔卞織綾?



Alexwan 2008-09-03 11:12 鍙戣〃璇勮
]]>
[hibernate]hibernate涓嚜瀹氫箟涓婚敭鐢熸垚鍣?/title><link>http://www.tkk7.com/alexwan/archive/2008/09/02/226316.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Tue, 02 Sep 2008 03:59:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/09/02/226316.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/226316.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/09/02/226316.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/226316.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/226316.html</trackback:ping><description><![CDATA[<strong>鑳屾櫙</strong>:<br /> Hibernate(鐩墠浣跨敤鐨勭増鏈槸3.2)涓彁渚涗簡澶氱鐢熸垚涓婚敭鐨勬柟寮?鍦ㄤ笅闈㈢殑鏂囩珷涓湁鍒楀嚭鏉?br /> <a title="[hibernate]Hibernate涓婚敭鐢熸垚鏂瑰紡 Key Generator " href="http://www.tkk7.com/alexwan/archive/2008/09/02/226299.html">[hibernate]Hibernate涓婚敭鐢熸垚鏂瑰紡 Key Generator </a><br /> <br /> 鐒惰屽綋鍓嶇殑榪欎箞澶氱鐢熸垚鏂瑰紡鏈繀鑳芥弧瓚蟲垜浠殑瑕佹眰.<br /> 姣斿<strong>increment</strong>,鍙互鍦ㄤ竴涓猦ibernate瀹炰緥鐨勫簲鐢ㄤ笂寰堟柟渚跨殑鏃跺?浣嗘槸鍦ㄩ泦緹ょ殑鏃跺欏氨涓嶈浜?<br /> 鍐嶅<strong> identity</strong> ,<strong>sequence</strong> ,<strong>native</strong> 鏄暟鎹眬鎻愪緵鐨勪富閿敓鎴愭柟寮?寰寰涔熶笉鏄垜浠渶瑕?鑰屼笖鍦ㄧ▼搴忚法鏁版嵁搴撴柟闈篃浣撶幇鍑轟笉瓚?<br /> 榪樻湁鍩轟簬綆楁硶鐨勭敓鎴愭柟寮忕敓鎴愬嚭鏉ョ殑涓婚敭鍩烘湰閮芥槸瀛楃涓茬殑.<br /> <br /> 鎴戜滑鐜板湪闇瑕佷竴縐嶇敓鎴愭柟寮?浣跨敤Long浣滀負涓婚敭綾誨瀷,鑷姩澧?鏀寔闆嗙兢.<br /> 閭d箞鎴戜滑闇瑕佽嚜瀹氫箟涓涓垜浠殑涓婚敭鐢熸垚鍣ㄦ墠鑳藉疄鐜頒簡.<br /> <br /> <strong>瀹炵幇浠g爜</strong>:<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff">package</span><span style="color: #000000"> hibernate;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.io.Serializable;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.sql.Connection;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.sql.PreparedStatement;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.sql.ResultSet;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.sql.SQLException;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.Properties;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.commons.logging.Log;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.commons.logging.LogFactory;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.hibernate.HibernateException;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.hibernate.MappingException;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.hibernate.dialect.Dialect;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.hibernate.engine.SessionImplementor;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.hibernate.id.Configurable;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.hibernate.id.IdentifierGenerator;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.hibernate.id.PersistentIdentifierGenerator;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.hibernate.type.Type;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_699_2226_Open_Image" onclick="this.style.display='none'; Codehighlighter1_699_2226_Open_Text.style.display='none'; Codehighlighter1_699_2226_Closed_Image.style.display='inline'; Codehighlighter1_699_2226_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_699_2226_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_699_2226_Closed_Text.style.display='none'; Codehighlighter1_699_2226_Open_Image.style.display='inline'; Codehighlighter1_699_2226_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> IncrementGenerator </span><span style="color: #0000ff">implements</span><span style="color: #000000"> IdentifierGenerator, Configurable </span><span id="Codehighlighter1_699_2226_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_699_2226_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">final</span><span style="color: #000000"> Log log </span><span style="color: #000000">=</span><span style="color: #000000"> LogFactory.getLog(IncrementGenerator.</span><span style="color: #0000ff">class</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> Long next;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> String sql;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> Serializable generate(SessionImplementor session, Object object)<br /> <img id="Codehighlighter1_927_1025_Open_Image" onclick="this.style.display='none'; Codehighlighter1_927_1025_Open_Text.style.display='none'; Codehighlighter1_927_1025_Closed_Image.style.display='inline'; Codehighlighter1_927_1025_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_927_1025_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_927_1025_Closed_Text.style.display='none'; Codehighlighter1_927_1025_Open_Image.style.display='inline'; Codehighlighter1_927_1025_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">throws</span><span style="color: #000000"> HibernateException </span><span id="Codehighlighter1_927_1025_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_927_1025_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_946_1001_Open_Image" onclick="this.style.display='none'; Codehighlighter1_946_1001_Open_Text.style.display='none'; Codehighlighter1_946_1001_Closed_Image.style.display='inline'; Codehighlighter1_946_1001_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_946_1001_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_946_1001_Closed_Text.style.display='none'; Codehighlighter1_946_1001_Open_Image.style.display='inline'; Codehighlighter1_946_1001_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (sql</span><span style="color: #000000">!=</span><span style="color: #0000ff">null</span><span style="color: #000000">) </span><span id="Codehighlighter1_946_1001_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_946_1001_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            getNext( session.connection() );<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />       </span><span style="color: #0000ff">return</span><span style="color: #000000"> next;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    <br /> <img id="Codehighlighter1_1117_1607_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1117_1607_Open_Text.style.display='none'; Codehighlighter1_1117_1607_Closed_Image.style.display='inline'; Codehighlighter1_1117_1607_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1117_1607_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1117_1607_Closed_Text.style.display='none'; Codehighlighter1_1117_1607_Open_Image.style.display='inline'; Codehighlighter1_1117_1607_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> configure(Type type, Properties params, Dialect d) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> MappingException </span><span id="Codehighlighter1_1117_1607_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1117_1607_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        String table </span><span style="color: #000000">=</span><span style="color: #000000"> params.getProperty(</span><span style="color: #000000">"</span><span style="color: #000000">table</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (table</span><span style="color: #000000">==</span><span style="color: #0000ff">null</span><span style="color: #000000">) table </span><span style="color: #000000">=</span><span style="color: #000000"> params.getProperty(PersistentIdentifierGenerator.TABLE);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        String column </span><span style="color: #000000">=</span><span style="color: #000000"> params.getProperty(</span><span style="color: #000000">"</span><span style="color: #000000">column</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (column</span><span style="color: #000000">==</span><span style="color: #0000ff">null</span><span style="color: #000000">) column </span><span style="color: #000000">=</span><span style="color: #000000"> params.getProperty(PersistentIdentifierGenerator.PK);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        String schema </span><span style="color: #000000">=</span><span style="color: #000000"> params.getProperty(PersistentIdentifierGenerator.SCHEMA);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        sql </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">select max(</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">column </span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">) from </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> ( schema</span><span style="color: #000000">==</span><span style="color: #0000ff">null</span><span style="color: #000000"> </span><span style="color: #000000">?</span><span style="color: #000000"> table : schema </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">.</span><span style="color: #000000">'</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> table );<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        log.info(sql);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    <br /> <img id="Codehighlighter1_1677_2224_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1677_2224_Open_Text.style.display='none'; Codehighlighter1_1677_2224_Closed_Image.style.display='inline'; Codehighlighter1_1677_2224_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1677_2224_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1677_2224_Closed_Text.style.display='none'; Codehighlighter1_1677_2224_Open_Image.style.display='inline'; Codehighlighter1_1677_2224_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />     </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> getNext(Connection conn) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> HibernateException </span><span id="Codehighlighter1_1677_2224_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1677_2224_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_1692_1961_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1692_1961_Open_Text.style.display='none'; Codehighlighter1_1692_1961_Closed_Image.style.display='inline'; Codehighlighter1_1692_1961_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1692_1961_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1692_1961_Closed_Text.style.display='none'; Codehighlighter1_1692_1961_Open_Image.style.display='inline'; Codehighlighter1_1692_1961_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span id="Codehighlighter1_1692_1961_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1692_1961_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                PreparedStatement st </span><span style="color: #000000">=</span><span style="color: #000000"> conn.prepareStatement(sql);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                ResultSet rs </span><span style="color: #000000">=</span><span style="color: #000000"> st.executeQuery();<br /> <img id="Codehighlighter1_1829_1887_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1829_1887_Open_Text.style.display='none'; Codehighlighter1_1829_1887_Closed_Image.style.display='inline'; Codehighlighter1_1829_1887_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1829_1887_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1829_1887_Closed_Text.style.display='none'; Codehighlighter1_1829_1887_Open_Image.style.display='inline'; Codehighlighter1_1829_1887_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />                </span><span style="color: #0000ff">if</span><span style="color: #000000"> ( rs.next() ) </span><span id="Codehighlighter1_1829_1887_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1829_1887_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                    next </span><span style="color: #000000">=</span><span style="color: #000000"> rs.getLong(</span><span style="color: #000000">1</span><span style="color: #000000">) </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />                }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_1907_1950_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1907_1950_Open_Text.style.display='none'; Codehighlighter1_1907_1950_Closed_Image.style.display='inline'; Codehighlighter1_1907_1950_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1907_1950_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1907_1950_Closed_Text.style.display='none'; Codehighlighter1_1907_1950_Open_Image.style.display='inline'; Codehighlighter1_1907_1950_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />                </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span id="Codehighlighter1_1907_1950_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1907_1950_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                    next </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">1l</span><span style="color: #000000">;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />                }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #0000ff">catch</span><span style="color: #000000">(SQLException e)<br /> <img id="Codehighlighter1_1993_2047_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1993_2047_Open_Text.style.display='none'; Codehighlighter1_1993_2047_Closed_Image.style.display='inline'; Codehighlighter1_1993_2047_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1993_2047_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1993_2047_Closed_Text.style.display='none'; Codehighlighter1_1993_2047_Open_Image.style.display='inline'; Codehighlighter1_1993_2047_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span id="Codehighlighter1_1993_2047_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1993_2047_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HibernateException(e);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_2066_2217_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2066_2217_Open_Text.style.display='none'; Codehighlighter1_2066_2217_Closed_Image.style.display='inline'; Codehighlighter1_2066_2217_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_2066_2217_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_2066_2217_Closed_Text.style.display='none'; Codehighlighter1_2066_2217_Open_Image.style.display='inline'; Codehighlighter1_2066_2217_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">finally</span><span style="color: #000000"> </span><span id="Codehighlighter1_2066_2217_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_2066_2217_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_2081_2117_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2081_2117_Open_Text.style.display='none'; Codehighlighter1_2081_2117_Closed_Image.style.display='inline'; Codehighlighter1_2081_2117_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_2081_2117_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_2081_2117_Closed_Text.style.display='none'; Codehighlighter1_2081_2117_Open_Image.style.display='inline'; Codehighlighter1_2081_2117_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />                </span><span style="color: #0000ff">try</span><span id="Codehighlighter1_2081_2117_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_2081_2117_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                conn.close();<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />                }</span></span><span style="color: #0000ff">catch</span><span style="color: #000000">(SQLException e)<br /> <img id="Codehighlighter1_2150_2206_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2150_2206_Open_Text.style.display='none'; Codehighlighter1_2150_2206_Closed_Image.style.display='inline'; Codehighlighter1_2150_2206_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_2150_2206_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_2150_2206_Closed_Text.style.display='none'; Codehighlighter1_2150_2206_Open_Image.style.display='inline'; Codehighlighter1_2150_2206_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />                </span><span id="Codehighlighter1_2150_2206_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_2150_2206_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                    </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HibernateException(e);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />                }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <br /> <br /> 閰嶇疆:<br /> 鍦ㄥ搴旂殑hbm鏂囦歡閲岄潰灝唅d鐨勯厤緗涓?<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000">        </span><span style="color: #0000ff"><</span><span style="color: #800000">id </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="id"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="long"</span><span style="color: #ff0000"> column</span><span style="color: #0000ff">="id"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">generator </span><span style="color: #ff0000">class</span><span style="color: #0000ff">="hibernate.IncrementGenerator"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">id</span><span style="color: #0000ff">></span></div> <br /> ps:姝ょ敓鎴愭柟寮忎粎閫氳繃涓や釜hibernate瀹炰緥嫻嬭瘯,濡傚彂鐜版湁闂,璇風暀璦.<br /> <img src ="http://www.tkk7.com/alexwan/aggbug/226316.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-09-02 11:59 <a href="http://www.tkk7.com/alexwan/archive/2008/09/02/226316.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[hibernate]Hibernate涓婚敭鐢熸垚鏂瑰紡 Key Generatorhttp://www.tkk7.com/alexwan/archive/2008/09/02/226299.htmlAlexwanAlexwanTue, 02 Sep 2008 03:24:00 GMThttp://www.tkk7.com/alexwan/archive/2008/09/02/226299.htmlhttp://www.tkk7.com/alexwan/comments/226299.htmlhttp://www.tkk7.com/alexwan/archive/2008/09/02/226299.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/226299.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/226299.html   涓婚敭浜х敓鍣? 
  鍙夐」璇存槑錛? 
  1)   assigned  
  涓婚敭鐢卞閮ㄧ▼搴忚礋璐g敓鎴愶紝鏃犻渶Hibernate鍙備笌銆? 
   
  2)   hilo  
  閫氳繃hi/lo   綆楁硶瀹炵幇鐨勪富閿敓鎴愭満鍒訛紝闇瑕侀澶栫殑鏁版嵁搴撹〃淇濆瓨涓? 
  閿敓鎴愬巻鍙茬姸鎬併? 
   
  3)   seqhilo  
  涓巋ilo   綾諱技錛岄氳繃hi/lo   綆楁硶瀹炵幇鐨勪富閿敓鎴愭満鍒訛紝鍙槸涓婚敭鍘嗗彶  
  鐘舵佷繚瀛樺湪Sequence涓紝閫傜敤浜庢敮鎸丼equence鐨勬暟鎹簱錛屽Oracle銆? 
   
  4)   increment  
  涓婚敭鎸夋暟鍊奸『搴忛掑銆傛鏂瑰紡鐨勫疄鐜版満鍒朵負鍦ㄥ綋鍓嶅簲鐢ㄥ疄渚嬩腑緇存寔  
  涓涓彉閲忥紝浠ヤ繚瀛樼潃褰撳墠鐨勬渶澶у鹼紝涔嬪悗姣忔闇瑕佺敓鎴愪富閿殑鏃跺? 
  灝嗘鍊煎姞1浣滀負涓婚敭銆? 
  榪欑鏂瑰紡鍙兘浜х敓鐨勯棶棰樻槸錛氬鏋滃綋鍓嶆湁澶氫釜瀹炰緥璁塊棶鍚屼竴涓暟鎹? 
  搴擄紝閭d箞鐢變簬鍚勪釜瀹炰緥鍚勮嚜緇存姢涓婚敭鐘舵侊紝涓嶅悓瀹炰緥鍙兘鐢熸垚鍚屾牱  
  鐨勪富閿紝浠庤岄犳垚涓婚敭閲嶅寮傚父銆傚洜姝わ紝濡傛灉鍚屼竴鏁版嵁搴撴湁澶氫釜瀹? 
  渚嬭闂紝姝ゆ柟寮忓繀欏婚伩鍏嶄嬌鐢ㄣ? 
   
  5)   identity  
  閲囩敤鏁版嵁搴撴彁渚涚殑涓婚敭鐢熸垚鏈哄埗銆傚DB2銆丼QL   Server銆丮ySQL  
  涓殑涓婚敭鐢熸垚鏈哄埗銆? 
   
  6)   sequence  
  閲囩敤鏁版嵁搴撴彁渚涚殑sequence   鏈哄埗鐢熸垚涓婚敭銆傚Oralce   涓殑  
  Sequence銆? 
   
  7)   native  
  鐢盚ibernate鏍規嵁搴曞眰鏁版嵁搴撹嚜琛屽垽鏂噰鐢╥dentity銆乭ilo銆乻equence  
  鍏朵腑涓縐嶄綔涓轟富閿敓鎴愭柟寮忋? 
   
  8)   uuid.hex  
  鐢盚ibernate鍩轟簬128   浣嶅敮涓鍊間駭鐢熺畻娉曠敓鎴?6   榪涘埗鏁板鹼紙緙栫爜鍚? 
  浠ラ暱搴?2   鐨勫瓧絎︿覆琛ㄧず錛変綔涓轟富閿? 
   
  9)   uuid.string  
  涓巙uid.hex   綾諱技錛屽彧鏄敓鎴愮殑涓婚敭鏈繘琛岀紪鐮侊紙闀垮害16錛夈傚湪鏌愪簺  
  鏁版嵁搴撲腑鍙兘鍑虹幇闂錛堝PostgreSQL錛夈? 
   
  10)   foreign  
  浣跨敤澶栭儴琛ㄧ殑瀛楁浣滀負涓婚敭銆? 
  涓鑸岃█錛屽埄鐢╱uid.hex鏂瑰紡鐢熸垚涓婚敭灝嗘彁渚涙渶濂界殑鎬ц兘鍜屾暟鎹簱騫沖彴閫? 
  搴旀с? 
   
  鍙﹀鐢變簬甯哥敤鐨勬暟鎹簱錛屽Oracle銆丏B2銆丼QLServer銆丮ySql   絳夛紝閮芥彁  
  渚涗簡鏄撶敤鐨勪富閿敓鎴愭満鍒訛紙Auto-Increase   瀛楁鎴栬匰equence錛夈傛垜浠彲浠ュ湪鏁? 
  鎹簱鎻愪緵鐨勪富閿敓鎴愭満鍒朵笂錛岄噰鐢╣enerator-class=native鐨勪富閿敓鎴愭柟寮忋? 
  涓嶈繃鍊煎緱娉ㄦ剰鐨勬槸錛屼竴浜涙暟鎹簱鎻愪緵鐨勪富閿敓鎴愭満鍒跺湪鏁堢巼涓婃湭蹇呮渶浣籌紝  
  澶ч噺騫跺彂insert鏁版嵁鏃跺彲鑳戒細寮曡搗琛ㄤ箣闂寸殑浜掗攣銆? 
  鏁版嵁搴撴彁渚涚殑涓婚敭鐢熸垚鏈哄埗錛屽線寰鏄氳繃鍦ㄤ竴涓唴閮ㄨ〃涓繚瀛樺綋鍓嶄富閿姸  
  鎬侊紙濡傚浜庤嚜澧炲瀷涓婚敭鑰岃█錛屾鍐呴儴琛ㄤ腑灝辯淮鎶ょ潃褰撳墠鐨勬渶澶у煎拰閫掑閲忥級錛? 
  涔嬪悗姣忔鎻掑叆鏁版嵁浼氳鍙栬繖涓渶澶у鹼紝鐒跺悗鍔犱笂閫掑閲忎綔涓烘柊璁板綍鐨勪富閿紝涔? 
  鍚庡啀鎶婅繖涓柊鐨勬渶澶у兼洿鏂板洖鍐呴儴琛ㄤ腑錛岃繖鏍鳳紝涓嬈nsert鎿嶄綔鍙兘瀵艱嚧鏁版嵁  
  搴撳唴閮ㄥ嬈¤〃璇誨啓鎿嶄綔錛屽悓鏃朵即闅忕殑榪樻湁鏁版嵁鐨勫姞閿佽В閿佹搷浣滐紝榪欏鎬ц兘浜х敓  
  浜嗚緝澶у獎鍝嶃? 
  鍥犳錛屽浜庡茍鍙慖nsert瑕佹眰杈冮珮鐨勭郴緇燂紝鎺ㄨ崘閲囩敤uuid.hex   浣滀負涓婚敭鐢熸垚  
  鏈哄埗銆?nbsp;   


Alexwan 2008-09-02 11:24 鍙戣〃璇勮
]]>
鍚冨姏涓嶈濂界殑鏃х郴緇熸暟鎹鍏ュ埌鏂扮郴緇?/title><link>http://www.tkk7.com/alexwan/archive/2008/08/15/222131.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Thu, 14 Aug 2008 18:39:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/08/15/222131.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/222131.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/08/15/222131.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/222131.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/222131.html</trackback:ping><description><![CDATA[         瀵規棫鐨勭郴緇熻繘琛屾敼閫犲悗,鍦ㄦ柊鐨勭郴緇熼噷闈㈡暟鎹殑緇撴瀯鍜屽叧緋婚兘鍜屼互鍓嶆湁浜嗘瘮杈冨ぇ鐨勫彉鍖?榪欑鎯呭喌涓?鎴戜滑娌℃湁鍔炴硶鍊熷姪鏁版嵁鐨勫鍏ュ鍑哄伐鍏峰幓鐩存帴鍦板皢涓や釜緋葷粺鐨勬暟鎹瀺鍚堣搗鏉?閭d箞鍞竴鐨勫姙娉曞氨鏄氳繃鍐欑▼搴忕殑鏉ュ疄鐜頒簡!<br />         鍙槸浜嬪疄涓?榪欑瀵兼暟鎹殑宸ヤ綔騫朵笉鏄兂璞′腑鐨勯偅涔堢畝鍗?棣栧厛闇瑕佹竻妤氫袱涓郴緇熶腑鍚勮嚜鍐呴儴鐨勬暟鎹殑鍏崇郴鏄庝箞鏍風殑,鍚﹀垯鏍規湰灝變笉鐭ラ亾濡備綍鍘誨仛鍏崇郴鐨勫鐞?榪欐牱鐨勪簨鎯呬笉鏄櫘閫氱殑紼嬪簭鍛樿兘澶勭悊鐨?鐢氳嚦灝辮繛鏈夌粡楠岀殑紼嬪簭鍛樹篃娌℃湁涓涓涔嬫湁鏁堢殑鏂規硶鍘昏繀閫熺殑瀹屾垚浠誨姟!閭f庝箞鍔炲憿?鍙ソ鍔ㄧ敤杈冩湁緇忛獙,瀵規柊鏃х郴緇熼兘鏈夌浉褰撲簡瑙g殑紼嬪簭鍛樺幓鍋氫簡!鎬繪槸鏈変漢璁や負榪欎簺涓棶棰樺埌浜嗕粬浠?鍓嶉潰鎸囩殑鏈夌粡楠岀殑紼嬪簭鍛?,灝卞彲浠ヨ繋鍒冭岃В浜?孌婁笉鐭?鏃犺瀵硅皝閮戒細閫犳垚寰堝ぇ鐨勬崯澶?涔熷緢灝戣兘浜嗚В鐨勮繖浜涗換鍔¢渶瑕佽楄垂澶氬皯鏃墮棿鍜岀簿鍔涘幓鍋?<br />         榪樻湁涓鐐逛篃鏄渶閲嶈鐨勪竴鐐?鏄▼搴忓憳鎵涓嶈兘鎺ュ彈鐨?灝辨槸榪欎釜瀵兼暟鎹殑紼嬪簭,鍦ㄥ瀹屾暟鎹箣鍚庡氨澶卞幓浜嗗瓨鍦ㄦ剰涔変簡.瀵圭▼搴忓憳鑰岃█,涓嶅紓浜庤鎶涘純鑷繁鐨勫瀛愪竴鏍風棝鑻?鍚屾椂涔熸槸瀵圭▼搴忓憳鍔沖姩鐨勪笉灝婇噸!<br />         鍙槸鐜板疄寰寰涓嶆槸紼嬪簭鍛樿兘宸﹀彸鐨?鏁版嵁榪樻槸瑕佸,綺懼姏鍜屾椂闂磋繕鏄鑰楄垂榪欎簺涓嬈℃х殑浠g爜閲岄潰!<br />         瀵逛簬榪欐牱鐨勯渶姹?涓漢娣辨伓鐥涚粷涔?鍚屾椂涓鴻嚜宸辯殑澶勫鎰熻寰堟棤濂?<br />         甯屾湜榪欐槸鏈鍚庝竴嬈¤繖涔堝仛! <img src ="http://www.tkk7.com/alexwan/aggbug/222131.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-08-15 02:39 <a href="http://www.tkk7.com/alexwan/archive/2008/08/15/222131.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[Extjs]杈撳嚭JSON鏃跺浘鐗囧強鏂囦歡闇瑕佸崟鐙鐞?/title><link>http://www.tkk7.com/alexwan/archive/2008/07/18/215900.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Fri, 18 Jul 2008 13:41:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/07/18/215900.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/215900.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/07/18/215900.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/215900.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/215900.html</trackback:ping><description><![CDATA[[Extjs]杈撳嚭JSON鏄浘鐗囧強鏂囦歡闇瑕佸崟鐙鐞?br /> 浠婂ぉ鍦ㄤ嬌鐢‥xtjs寮鍙戠殑鍚庡彴緋葷粺涓鍒頒竴涓緢濂囨殑閿欒,浠庝竴涓彧鏈夊緢灝戣褰曠殑鏁版嵁琛ㄤ腑鏌ユ暟鎹嚭鏉ョ珶鐒剁敤浜?縐掑;<br /> 鑰屼笖浼氬湪firefox涓彲浠ユ樉紺哄嚭鏉?鍦↖E涓嵈娌℃湁鏄劇ず鍑烘潵(閫氳繃grid鏉ユ樉紺?,鏈鍚?鎴戦氳繃鍦ㄦ湇鍔$鎵撳嵃鍝嶅簲涓殑鍐呭,<br /> 绔熺劧璁╂垜鐨別clipse閮藉崱浣忎簡,絳夌紦榪囨潵鏌ョ湅杈撳嚭鐨勬椂鍊欏彂鐜?鍘熸潵鏄湇鍔$杈撳嚭json鐨勬椂鍊欐妸鍥劇墖鐨勫瓧鑺傚間篃涓璧鋒墦鍗板嚭鏉ヤ簡,<br /> 鎵浠ユ墠浼氬鑷磂clipse鍗′綇騫朵笖鍗充嬌鑳借緭鍑轟篃鏄浉褰撳緱鎱?鑰屼笖鍑犳潯鏁版嵁鐨勫浘鐗囩殑杈撳嚭鍊煎氨璁㊣E澶勭悊涓嶄簡!!<br /> 鎵浠?濡傛灉瑕佸湪鏁版嵁琛ㄥ唴瀛樺偍鍥劇墖(鏂囦歡)鏃?涓嶈兘灝嗗浘鐗囩殑瀛楄妭鍊間篃褰撲綔JSON杈撳嚭鍒板鎴風,濡傛灉闇瑕佹樉紺鴻繕鏄崟鐙鐞嗕負濡? <img src ="http://www.tkk7.com/alexwan/aggbug/215900.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-07-18 21:41 <a href="http://www.tkk7.com/alexwan/archive/2008/07/18/215900.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>綆鍗曞疄鐜癕D5鍔犲瘑瀛楃涓?/title><link>http://www.tkk7.com/alexwan/archive/2008/06/30/211786.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Mon, 30 Jun 2008 15:34:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/06/30/211786.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/211786.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/06/30/211786.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/211786.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/211786.html</trackback:ping><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080"> 1</span><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff">package</span><span style="color: #000000"> util;<br /> </span><span style="color: #008080"> 2</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> </span><span style="color: #008080"> 3</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.security.MessageDigest;<br /> </span><span style="color: #008080"> 4</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> </span><span style="color: #008080"> 5</span><span style="color: #000000"><img id="Codehighlighter1_76_1718_Open_Image" onclick="this.style.display='none'; Codehighlighter1_76_1718_Open_Text.style.display='none'; Codehighlighter1_76_1718_Closed_Image.style.display='inline'; Codehighlighter1_76_1718_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_76_1718_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_76_1718_Closed_Text.style.display='none'; Codehighlighter1_76_1718_Open_Image.style.display='inline'; Codehighlighter1_76_1718_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> StringUtil </span><span id="Codehighlighter1_76_1718_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_76_1718_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080"> 6</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> </span><span style="color: #008080"> 7</span><span style="color: #000000"><img id="Codehighlighter1_124_220_Open_Image" onclick="this.style.display='none'; Codehighlighter1_124_220_Open_Text.style.display='none'; Codehighlighter1_124_220_Closed_Image.style.display='inline'; Codehighlighter1_124_220_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_124_220_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_124_220_Closed_Text.style.display='none'; Codehighlighter1_124_220_Open_Image.style.display='inline'; Codehighlighter1_124_220_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">final</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> String[] hexDigits </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span id="Codehighlighter1_124_220_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_124_220_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080"> 8</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          </span><span style="color: #000000">"</span><span style="color: #000000">0</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">1</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">2</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">3</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">4</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">5</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">6</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">7</span><span style="color: #000000">"</span><span style="color: #000000">, <br /> </span><span style="color: #008080"> 9</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />          </span><span style="color: #000000">"</span><span style="color: #000000">8</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">9</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">a</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">b</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">c</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">d</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">e</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">f</span><span style="color: #000000">"</span><span style="color: #000000">}</span></span><span style="color: #000000">; <br /> </span><span style="color: #008080">10</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">11</span><span style="color: #000000"><img id="Codehighlighter1_228_302_Open_Image" onclick="this.style.display='none'; Codehighlighter1_228_302_Open_Text.style.display='none'; Codehighlighter1_228_302_Closed_Image.style.display='inline'; Codehighlighter1_228_302_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_228_302_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_228_302_Closed_Text.style.display='none'; Codehighlighter1_228_302_Open_Image.style.display='inline'; Codehighlighter1_228_302_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />      </span><span id="Codehighlighter1_228_302_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/** */</span><span id="Codehighlighter1_228_302_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"> <br /> </span><span style="color: #008080">12</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />       * 杞崲瀛楄妭鏁扮粍涓?6榪涘埗瀛椾覆 <br /> </span><span style="color: #008080">13</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />       * </span><span style="color: #808080">@param</span><span style="color: #008000"> b 瀛楄妭鏁扮粍 <br /> </span><span style="color: #008080">14</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />       * </span><span style="color: #808080">@return</span><span style="color: #008000"> 16榪涘埗瀛椾覆 <br /> </span><span style="color: #008080">15</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />       </span><span style="color: #008000">*/</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">16</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">17</span><span style="color: #000000"><img id="Codehighlighter1_361_550_Open_Image" onclick="this.style.display='none'; Codehighlighter1_361_550_Open_Text.style.display='none'; Codehighlighter1_361_550_Closed_Image.style.display='inline'; Codehighlighter1_361_550_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_361_550_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_361_550_Closed_Text.style.display='none'; Codehighlighter1_361_550_Open_Image.style.display='inline'; Codehighlighter1_361_550_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />      </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> String byteArrayToHexString(</span><span style="color: #0000ff">byte</span><span style="color: #000000">[] b) </span><span id="Codehighlighter1_361_550_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_361_550_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">18</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        StringBuffer resultSb </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> StringBuffer(); <br /> </span><span style="color: #008080">19</span><span style="color: #000000"><img id="Codehighlighter1_454_510_Open_Image" onclick="this.style.display='none'; Codehighlighter1_454_510_Open_Text.style.display='none'; Codehighlighter1_454_510_Closed_Image.style.display='inline'; Codehighlighter1_454_510_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_454_510_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_454_510_Closed_Text.style.display='none'; Codehighlighter1_454_510_Open_Image.style.display='inline'; Codehighlighter1_454_510_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> b.length; i</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_454_510_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_454_510_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">20</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          resultSb.append(byteToHexString(b[i])); <br /> </span><span style="color: #008080">21</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">22</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> resultSb.toString(); <br /> </span><span style="color: #008080">23</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />      }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">24</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">25</span><span style="color: #000000"><img id="Codehighlighter1_603_754_Open_Image" onclick="this.style.display='none'; Codehighlighter1_603_754_Open_Text.style.display='none'; Codehighlighter1_603_754_Closed_Image.style.display='inline'; Codehighlighter1_603_754_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_603_754_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_603_754_Closed_Text.style.display='none'; Codehighlighter1_603_754_Open_Image.style.display='inline'; Codehighlighter1_603_754_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />      </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> String byteToHexString(</span><span style="color: #0000ff">byte</span><span style="color: #000000"> b) </span><span id="Codehighlighter1_603_754_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_603_754_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">26</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> n </span><span style="color: #000000">=</span><span style="color: #000000"> b; <br /> </span><span style="color: #008080">27</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (n </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">) <br /> </span><span style="color: #008080">28</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          n </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">256</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> n; <br /> </span><span style="color: #008080">29</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> d1 </span><span style="color: #000000">=</span><span style="color: #000000"> n </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">16</span><span style="color: #000000">; <br /> </span><span style="color: #008080">30</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> d2 </span><span style="color: #000000">=</span><span style="color: #000000"> n </span><span style="color: #000000">%</span><span style="color: #000000"> </span><span style="color: #000000">16</span><span style="color: #000000">; <br /> </span><span style="color: #008080">31</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> hexDigits[d1] </span><span style="color: #000000">+</span><span style="color: #000000"> hexDigits[d2]; <br /> </span><span style="color: #008080">32</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />      }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">33</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">34</span><span style="color: #000000"><img id="Codehighlighter1_807_1114_Open_Image" onclick="this.style.display='none'; Codehighlighter1_807_1114_Open_Text.style.display='none'; Codehighlighter1_807_1114_Closed_Image.style.display='inline'; Codehighlighter1_807_1114_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_807_1114_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_807_1114_Closed_Text.style.display='none'; Codehighlighter1_807_1114_Open_Image.style.display='inline'; Codehighlighter1_807_1114_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />      </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> String MD5Encode(String origin) </span><span id="Codehighlighter1_807_1114_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_807_1114_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">35</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        String resultString </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">; <br /> </span><span style="color: #008080">36</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">37</span><span style="color: #000000"><img id="Codehighlighter1_854_1043_Open_Image" onclick="this.style.display='none'; Codehighlighter1_854_1043_Open_Text.style.display='none'; Codehighlighter1_854_1043_Closed_Image.style.display='inline'; Codehighlighter1_854_1043_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_854_1043_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_854_1043_Closed_Text.style.display='none'; Codehighlighter1_854_1043_Open_Image.style.display='inline'; Codehighlighter1_854_1043_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span id="Codehighlighter1_854_1043_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_854_1043_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">38</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          resultString</span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000"> String(origin); <br /> </span><span style="color: #008080">39</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          MessageDigest md </span><span style="color: #000000">=</span><span style="color: #000000"> MessageDigest.getInstance(</span><span style="color: #000000">"</span><span style="color: #000000">MD5</span><span style="color: #000000">"</span><span style="color: #000000">); <br /> </span><span style="color: #008080">40</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          resultString</span><span style="color: #000000">=</span><span style="color: #000000">byteArrayToHexString(md.digest(resultString.getBytes())); <br /> </span><span style="color: #008080">41</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">42</span><span style="color: #000000"><img id="Codehighlighter1_1072_1081_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1072_1081_Open_Text.style.display='none'; Codehighlighter1_1072_1081_Closed_Image.style.display='inline'; Codehighlighter1_1072_1081_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1072_1081_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1072_1081_Closed_Text.style.display='none'; Codehighlighter1_1072_1081_Open_Image.style.display='inline'; Codehighlighter1_1072_1081_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">catch</span><span style="color: #000000"> (Exception ex) </span><span id="Codehighlighter1_1072_1081_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1072_1081_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">43</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">44</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">45</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> resultString; <br /> </span><span style="color: #008080">46</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />      }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">47</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">48</span><span style="color: #000000"><img id="Codehighlighter1_1159_1415_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1159_1415_Open_Text.style.display='none'; Codehighlighter1_1159_1415_Closed_Image.style.display='inline'; Codehighlighter1_1159_1415_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1159_1415_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1159_1415_Closed_Text.style.display='none'; Codehighlighter1_1159_1415_Open_Image.style.display='inline'; Codehighlighter1_1159_1415_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />      </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args)</span><span id="Codehighlighter1_1159_1415_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1159_1415_Open_Text"><span style="color: #000000">{ <br /> </span><span style="color: #008080">49</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          System.err.println(MD5Encode(</span><span style="color: #000000">""</span><span style="color: #000000">)); <br /> </span><span style="color: #008080">50</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          System.err.println(MD5Encode(</span><span style="color: #000000">"</span><span style="color: #000000">a</span><span style="color: #000000">"</span><span style="color: #000000">)); <br /> </span><span style="color: #008080">51</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          System.err.println(MD5Encode(</span><span style="color: #000000">"</span><span style="color: #000000">abc</span><span style="color: #000000">"</span><span style="color: #000000">)); <br /> </span><span style="color: #008080">52</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          System.err.println(MD5Encode(</span><span style="color: #000000">"</span><span style="color: #000000">message digest</span><span style="color: #000000">"</span><span style="color: #000000">)); <br /> </span><span style="color: #008080">53</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          System.err.println(MD5Encode(</span><span style="color: #000000">"</span><span style="color: #000000">abcdefghijklmnopqrstuvwxyz</span><span style="color: #000000">"</span><span style="color: #000000">)); <br /> </span><span style="color: #008080">54</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> </span><span style="color: #008080">55</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />      }</span></span><span style="color: #000000"> <br /> </span><span style="color: #008080">56</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      <br /> </span><span style="color: #008080">57</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      </span><span style="color: #008000">//</span><span style="color: #008000">MD5 ("") = d41d8cd98f00b204e9800998ecf8427e<br /> </span><span style="color: #008080">58</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      </span><span style="color: #008000">//</span><span style="color: #008000">MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661<br /> </span><span style="color: #008080">59</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      </span><span style="color: #008000">//</span><span style="color: #008000">MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72<br /> </span><span style="color: #008080">60</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      </span><span style="color: #008000">//</span><span style="color: #008000">MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0<br /> </span><span style="color: #008080">61</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      </span><span style="color: #008000">//</span><span style="color: #008000">MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b</span><span style="color: #008000"><br /> </span><span style="color: #008080">62</span><span style="color: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">       <br /> </span><span style="color: #008080">63</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">64</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> </span><span style="color: #008080">65</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">66</span><span style="color: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <img src ="http://www.tkk7.com/alexwan/aggbug/211786.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-06-30 23:34 <a href="http://www.tkk7.com/alexwan/archive/2008/06/30/211786.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Top Ten Errors Java Programmers Makehttp://www.tkk7.com/alexwan/archive/2008/06/24/210332.htmlAlexwanAlexwanTue, 24 Jun 2008 08:17:00 GMThttp://www.tkk7.com/alexwan/archive/2008/06/24/210332.htmlhttp://www.tkk7.com/alexwan/comments/210332.htmlhttp://www.tkk7.com/alexwan/archive/2008/06/24/210332.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/210332.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/210332.html http://www.javacoffeebreak.com/articles/toptenerrors.html

Whether you program regularly in Java, and know it like the back of your hand, or whether you're new to the language or a casual programmer, you'll make mistakes. It's natural, it's human, and guess what? You'll more than likely make the same mistakes that others do, over and over again. Here's my top ten list of errors that we all seem to make at one time or another,  how to spot them, and how to fix them.

10. Accessing non-static member variables from static methods (such as main)

Many programmers, particularly when first introduced to Java, have problems with accessing member variables from their main method. The method signature for main is marked static - meaning that we don't need to create an instance of the class to invoke the main method. For example, a Java Virtual Machine (JVM) could call the class MyApplication like this :-

MyApplication.main ( command_line_args );

This means, however, that there isn't an instance of MyApplication - it doesn't have any member variables to access! Take for example the following application, which will generate a compiler error message.

public class StaticDemo
{
public String my_member_variable = "somedata";
        public static void main (String args[])
{
// Access a non-static member from static method
System.out.println ("This generates a compiler error" +
my_member_variable );
}
}

If you want to access its member variables from a non-static method (like main), you must create an instance of the object. Here's a simple example of how to correctly write code to access non-static member variables, by first creating an instance of the object.

public class NonStaticDemo
{
public String my_member_variable = "somedata";
public static void main (String args[])
{
NonStaticDemo demo = new NonStaticDemo();
// Access member variable of demo
System.out.println ("This WON'T generate an error" +
demo.my_member_variable );
}
}

9. Mistyping the name of a method when overriding

Overriding allows programmers to replace a method's implementation with new code. Overriding is a handy feature, and most OO programmers make heavy use of it. If you use the AWT 1.1 event handling model, you'll often override listener implementations to provide custom functionality. One easy trap to fall into with overriding, is to mistype the method name. If you mistype the name, you're no longer overriding a method - you're creating an entirely new method, but with the same parameter and return type.

public class MyWindowListener extends WindowAdapter {
// This should be WindowClosed
public void WindowClose(WindowEvent e) {
// Exit when user closes window
System.exit(0);
}
});

Compilers won't pick up on this one, and the problem can be quite frustrating to detect. In the past, I've looked at a method, believed that it was being called, and taken ages to spot the problem. The symptom of this error will be that your code isn't being called, or you think the method has skipped over its code. The only way to ever be certain is to add a println statement, to record a message in a log file, or to use good trace debugger (like Visual J++ or Borland JBuilder) and step through line by line. If your method still isn't being called, then it's likely you've mistyped the name.

8. Comparison assignment (  = rather than == )

This is an easy error to make. If you're used other languages before, such as Pascal, you'll realize just how poor a choice this was by the language's designers. In Pascal, for example, we use the := operator for assignment, and leave = for comparison. This looks like a throwback to C/C++, from which Java draws its roots.

Fortunately, even if you don't spot this one by looking at code on the screen, your compiler will. Most commonly, it will report an error message like this : "Can't convert xxx to boolean", where xxx is a Java type that you're assigning instead of comparing.

7. Comparing two objects ( == instead of .equals)

When we use the == operator, we are actually comparing two object references, to see if they point to the same object. We cannot compare, for example, two strings for equality, using the == operator. We must instead use the .equals method, which is a method inherited by all classes from java.lang.Object.

Here's the correct way to compare two strings.

String abc = "abc"; String def = "def";
// Bad way
if ( (abc + def) == "abcdef" )
{
    ......
}
// Good way
if ( (abc + def).equals("abcdef") )
{
   .....
}

6. Confusion over passing by value, and passing by reference

This can be a frustrating problem to diagnose, because when you look at the code, you might be sure that its passing by reference, but find that its actually being passed by value. Java uses both, so you need to understand when you're passing by value, and when you're passing by reference.

When you pass a primitive data type, such as a char, int, float, or double, to a function then you are passing by value. That means that a copy of the data type is duplicated, and passed to the function. If the function chooses to modify that value, it will be modifying the copy only. Once the function finishes, and control is returned to the returning function, the "real" variable will be untouched, and no changes will have been saved. If you need to modify a primitive data type, make it a return value for a function, or wrap it inside an object.

When you pass a Java object, such as an array, a vector, or a string, to a function then you are passing by reference. Yes - a String is actually an object, not a primitive data type.  So that means that if you pass an object to a function, you are passing a reference to it, not a duplicate. Any changes you make to the object's member variables will be permanent - which can be either good or bad, depending on whether this was what you intended.

On a side note, since String contains no methods to modify its contents, you might as well be passing by value.

5. Writing blank exception handlers

I know it's very tempting to write blank exception handlers, and to just ignore errors. But if you run into problems, and haven't written any error messages, it becomes almost impossible to find out the cause of the error. Even the simplest exception handler can be of benefit. For example, put a try { .. } catch Exception around your code, to catch ANY type of exception, and print out the message. You don't need to write a custom handler for every exception (though this is still good programming practice). Don't ever leave it blank, or you won't know what's happening.

For example

public static void main(String args[])
{
    try {
// Your code goes here..
    }
    catch (Exception e)
    {
System.out.println ("Err - " + e );
    }
}

4. Forgetting that Java is zero-indexed

If you've come from a C/C++ background, you may not find this quite as much a problem as those who have used other languages. In Java, arrays are zero-indexed, meaning that the first element's index is actually 0. Confused? Let's look at a quick example.

// Create an array of three strings
String[] strArray = new String[3];
// First element's index is actually 0
strArray[0] = "First string";
// Second element's index is actually 1
strArray[1] = "Second string";
// Final element's index is actually 2
strArray[2] = "Third and final string";

In this example, we have an array of three strings, but to access elements of the array we actually subtract one. Now, if we were to try and access strArray[3], we'd be accessing the fourth element. This will case an ArrayOutOfBoundsException to be thrown - the most obvious sign of forgetting the zero-indexing rule.

Other areas where zero-indexing can get you into trouble is with strings. Suppose you wanted to get a character at a particular offset within a string. Using the String.charAt(int) function you can look this information up - but under Java, the String class is also zero-indexed. That means than the first character is at offset 0, and second at offset 1. You can run into some very frustrating problems unless you are aware of this - particularly if you write applications with heavy string processing. You can be working on the wrong character, and also throw exceptions at run-time. Just like the ArrayOutOfBoundsException, there is a string equivalent. Accessing beyond the bounds of a String will cause a StringIndexOutOfBoundsException to be thrown, as demonstrated by this example.

public class StrDemo
{
public static void main (String args[])
{
String abc = "abc";
System.out.println ("Char at offset 0 : " + abc.charAt(0) );
System.out.println ("Char at offset 1 : " + abc.charAt(1) );
System.out.println ("Char at offset 2 : " + abc.charAt(2) );
// This line should throw a StringIndexOutOfBoundsException
System.out.println ("Char at offset 3 : " + abc.charAt(3) );
}
}

Note too, that zero-indexing doesn't just apply to arrays, or to Strings. Other parts of Java are also indexed, but not always consistently. The java.util.Date, and java.util.Calendar classes start their months with 0, but days start normally with 1. This problem is demonstrated by the following application.

import java.util.Date;
import java.util.Calendar;
public class ZeroIndexedDate
{
public static void main (String args[])
{
// Get today's date
Date today = new Date();
// Print return value of getMonth
System.out.println ("Date.getMonth() returns : " +
today.getMonth());
// Get today's date using a Calendar
Calendar rightNow = Calendar.getInstance();
// Print return value of get ( Calendar.MONTH )
System.out.println ("Calendar.get (month) returns : " +
rightNow.get ( Calendar.MONTH ));
        }
}

Zero-indexing is only a problem if you don't realize that its occurring. If you think you're running into a problem, always consult your API documentation.

3. Preventing concurrent access to shared variables by threads

When writing multi-threaded applications, many programmers (myself included) often cut corners, and leave their applications and applets vulnerable to thread conflicts. When two or more threads access the same data concurrently, there exists the possibility (and Murphy's law holding, the probability) that two threads will access or modify the same data at the same time. Don't be fooled into thinking that such problems won't occur on single-threaded processors. While accessing some data (performing a read), your thread may be suspended, and another thread scheduled. It writes its data, which is then overwritten when the first thread makes its changes.

Such problems are not just limited to multi-threaded applications or applets. If you write Java APIs, or JavaBeans, then your code may not be thread-safe. Even if you never write a single application that uses threads, people that use your code WILL. For the sanity of others, if not yourself, you should always take precautions to prevent concurrent access to shared data.

How can this problem be solved? The simplest method is to make your variables private (but you do that already,  right?) and to use synchronized accessor methods. Accessor methods allow access to private member variables, but in a controlled manner. Take the following accessor methods, which provide a safe way to change the value of a counter.

public class MyCounter
{
private int count = 0; // count starts at zero
public synchronized void setCount(int amount)
{
count = amount;
}
public synchronized int getCount()
{
return count;
}
}

2. Capitalization errors

This is one of the most frequent errors that we all make. It's so simple to do, and sometimes one can look at an uncapitalized variable or method and still not spot the problem. I myself have often been puzzled by these errors, because I recognize that the method or variable does exist, but don't spot the lack of capitalization.

While there's no silver bullet for detecting this error, you can easily train yourself to make less of them. There's a very simple trick you can learn :-

  • all methods and member variables in the Java API begin with lowercase letters
  • all methods and member variables use capitalization where a new word begins e.g - getDoubleValue()

If you use this pattern for all of your member variables and classes, and then make a conscious effort to get it right, you can gradually reduce the number of mistakes you'll make. It may take a while, but it can save some serious head scratching in the future.

(drum roll)

And the number one error that Java programmers make !!!!!

 

1. Null pointers!

Null pointers are one of the most common errors that Java programmers make. Compilers can't check this one for you - it will only surface at runtime, and if you don't discover it, your users certainly will.

When an attempt to access an object is made, and the reference to that object is null, a NullPointerException will be thrown. The cause of null pointers can be varied, but generally it means that either you haven't initialized an object, or you haven't checked the return value of a function.

Many functions return null to indicate an error condition - but unless you check your return values, you'll never know what's happening. Since the cause is an error condition, normal testing may not pick it up - which means that your users will end up discovering the problem for you. If the API function indicates that null may be returned, be sure to check this before using the object reference!

Another cause is where your initialization has been sloppy, or where it is conditional. For example, examine the following code, and see if you can spot the problem.

public static void main(String args[])
{
// Accept up to 3 parameters
String[] list = new String[3];
int index = 0;
while ( (index < args.length) && ( index < 3 ) )
{
list[index++] = args[index];
}
// Check all the parameters
for (int i = 0; i < list.length; i++)
{
if (list[i].equals "-help")
{
// .........
}
else
if (list[i].equals "-cp")
{
// .........
}
// else .....
}
}

This code (while a contrived example), shows a common mistake. Under some circumstances, where the user enters three or more parameters, the code will run fine. If no parameters are entered, you'll get a NullPointerException at runtime. Sometimes your variables (the array of strings) will be initialized, and other times they won't. One easy solution is to check BEFORE you attempt to access a variable in an array that it is not equal to null.

Summary

These errors represent but some of the many that we all make. Though it is impossible to completely eliminate errors from the coding process, with care and practice you can avoid repeating the same ones. Rest assured, however, that all Java programmers encounter the same sorts of problems. It's comforting to know, that while you work late into the night tracking down an error, someone, somewhere, sometime, will make the same mistake!

We'd like to thank the readers of the comp.lang.java.programmer newsgroup for their suggestions for the top ten. Regrettably, due to the number of submissions, not every error could be featured - but we think this "Top Ten" list represents the most popular and frequent errors people make.


Alexwan 2008-06-24 16:17 鍙戣〃璇勮
]]>
spring妗嗘灦浣跨敤浠誨姟璋冨害quartz鐨勪緥瀛?TriggerListener 綃?/title><link>http://www.tkk7.com/alexwan/archive/2008/06/12/207273.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Thu, 12 Jun 2008 00:42:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/06/12/207273.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/207273.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/06/12/207273.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/207273.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/207273.html</trackback:ping><description><![CDATA[     鎽樿:         鏈夋椂鍊欐垜浠殑浠誨姟(Job)闇瑕佸啀鏌愪簺浠誨姟瀹屾垚涔嬪悗鎵嶈兘榪涜錛涗緥濡備粠鏃х殑鏁版嵁搴撴壒閲忓鏁版嵁鐨勬椂鍊欙紱闇瑕佺幇灝嗚鍏朵粬鏁版嵁渚濊禆鐨勬暟鎹鍏ユ柊鐨勬暟鎹簱錛涚劧鍚庡啀榪涜鍏崇郴鐨勫鍏?銆傚湪榪欑鎯呭喌涓嬫垜浠氨鍙互浣跨敤Quartz鐨刲istener鏉ュ仛鏂囩珷浜嗐?       ...  <a href='http://www.tkk7.com/alexwan/archive/2008/06/12/207273.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/alexwan/aggbug/207273.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-06-12 08:42 <a href="http://www.tkk7.com/alexwan/archive/2008/06/12/207273.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>spring妗嗘灦浣跨敤浠誨姟璋冨害quartz鐨勪緥瀛?Job and Trigger 綃?/title><link>http://www.tkk7.com/alexwan/archive/2008/06/11/207241.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Wed, 11 Jun 2008 15:21:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/06/11/207241.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/207241.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/06/11/207241.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/207241.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/207241.html</trackback:ping><description><![CDATA[MainJob.java<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080"> 1</span><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> jobs;<br /> </span><span style="color: #008080"> 2</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> </span><span style="color: #008080"> 3</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.log4j.Logger;<br /> </span><span style="color: #008080"> 4</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.quartz.JobExecutionContext;<br /> </span><span style="color: #008080"> 5</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.quartz.JobExecutionException;<br /> </span><span style="color: #008080"> 6</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.springframework.scheduling.quartz.QuartzJobBean;<br /> </span><span style="color: #008080"> 7</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> </span><span style="color: #008080"> 8</span><span style="color: #000000"><img id="Codehighlighter1_231_468_Open_Image" onclick="this.style.display='none'; Codehighlighter1_231_468_Open_Text.style.display='none'; Codehighlighter1_231_468_Closed_Image.style.display='inline'; Codehighlighter1_231_468_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_231_468_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_231_468_Closed_Text.style.display='none'; Codehighlighter1_231_468_Open_Image.style.display='inline'; Codehighlighter1_231_468_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> MainJob </span><span style="color: #0000ff">extends</span><span style="color: #000000"> QuartzJobBean </span><span id="Codehighlighter1_231_468_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_231_468_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080"> 9</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">private</span><span style="color: #000000">  Logger logger </span><span style="color: #000000">=</span><span style="color: #000000"> Logger.getLogger(getClass());<br /> </span><span style="color: #008080">10</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    @Override<br /> </span><span style="color: #008080">11</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">protected</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> executeInternal(JobExecutionContext context)<br /> </span><span style="color: #008080">12</span><span style="color: #000000"><img id="Codehighlighter1_393_465_Open_Image" onclick="this.style.display='none'; Codehighlighter1_393_465_Open_Text.style.display='none'; Codehighlighter1_393_465_Closed_Image.style.display='inline'; Codehighlighter1_393_465_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_393_465_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_393_465_Closed_Text.style.display='none'; Codehighlighter1_393_465_Open_Image.style.display='inline'; Codehighlighter1_393_465_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">throws</span><span style="color: #000000"> JobExecutionException </span><span id="Codehighlighter1_393_465_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_393_465_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">13</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000"> TODO Auto-generated method stub</span><span style="color: #008000"><br /> </span><span style="color: #008080">14</span><span style="color: #008000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        logger.debug(</span><span style="color: #000000">"</span><span style="color: #000000">Just say hi.</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> </span><span style="color: #008080">15</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">16</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> </span><span style="color: #008080">17</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">18</span><span style="color: #000000"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> application.xml<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000ff">?></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">beans </span><span style="color: #ff0000">xmlns</span><span style="color: #0000ff">="http://www.springframework.org/schema/beans"</span><span style="color: #ff0000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xmlns:xsi</span><span style="color: #0000ff">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #ff0000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xmlns:jee</span><span style="color: #0000ff">="http://www.springframework.org/schema/jee"</span><span style="color: #ff0000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xsi:schemaLocation</span><span style="color: #0000ff">="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />           http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #008000"><!--</span><span style="color: #008000"> 浠誨姟璋冨害瀵硅薄 </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">bean </span><span style="color: #ff0000">id</span><span style="color: #0000ff">="mainJob"</span><span style="color: #ff0000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        class</span><span style="color: #0000ff">="org.springframework.scheduling.quartz.JobDetailBean"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #008000"><!--</span><span style="color: #008000"> 榪愯鐨勭被 </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jobClass"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000">jobs.MainJob</span><span style="color: #0000ff"></</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #008000"><!--</span><span style="color: #008000"> 闇瑕佺敤鍒扮殑瀵硅薄 </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jobDataAsMap"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">map</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"><</span><span style="color: #800000">entry </span><span style="color: #ff0000">key</span><span style="color: #0000ff">="data"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                    </span><span style="color: #0000ff"><</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000">data</span><span style="color: #0000ff"></</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"></</span><span style="color: #800000">entry</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"></</span><span style="color: #800000">map</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">bean</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #008000"><!--</span><span style="color: #008000"> 綆鍗曠殑瑙﹀彂鍣?nbsp;</span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">bean </span><span style="color: #ff0000">id</span><span style="color: #0000ff">="mainTrigger"</span><span style="color: #ff0000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        class</span><span style="color: #0000ff">="org.springframework.scheduling.quartz.SimpleTriggerBean"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jobDetail"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #008000"><!--</span><span style="color: #008000"> 涓婇潰鍒涘緩鐨勪換鍔¤皟搴﹀璞?nbsp;</span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">ref </span><span style="color: #ff0000">bean</span><span style="color: #0000ff">="mainJob"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #008000"><!--</span><span style="color: #008000"> 鍚姩60縐掑悗鎵ц浠誨姟璋冨害鐨別xcute鏂規硶 </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="startDelay"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000">6000</span><span style="color: #0000ff"></</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #008000"><!--</span><span style="color: #008000"> 榪愯嬈℃暟 </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="repeatCount"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000">0</span><span style="color: #0000ff"></</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #008000"><!--</span><span style="color: #008000"> 闅斾竴涓皬鏃惰繍琛屼竴嬈?璨屼技澶氫綑,涓嶅啓浼氭姤閿? </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="repeatInterval"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000">3600000</span><span style="color: #0000ff"></</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">bean</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    <br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        <br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    <br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #008000"><!--</span><span style="color: #008000"> 浠誨姟璋冨害宸ュ巶綾?nbsp;</span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">bean<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #ff0000">class</span><span style="color: #0000ff">="org.springframework.scheduling.quartz.SchedulerFactoryBean"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #008000"><!--</span><span style="color: #008000"> 榪欎竴閮ㄥ垎鐨勯厤緗笉鐢ㄧ </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="quartzProperties"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">props</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"><</span><span style="color: #800000">prop </span><span style="color: #ff0000">key</span><span style="color: #0000ff">="org.quartz.threadPool.class"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                    org.quartz.simpl.SimpleThreadPool<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"></</span><span style="color: #800000">prop</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"><</span><span style="color: #800000">prop </span><span style="color: #ff0000">key</span><span style="color: #0000ff">="org.quartz.threadPool.threadCount"</span><span style="color: #0000ff">></span><span style="color: #000000">10</span><span style="color: #0000ff"></</span><span style="color: #800000">prop</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"><</span><span style="color: #800000">prop </span><span style="color: #ff0000">key</span><span style="color: #0000ff">="org.quartz.threadPool.threadPriority"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                    5<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"></</span><span style="color: #800000">prop</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"><</span><span style="color: #800000">prop<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                    </span><span style="color: #ff0000">key</span><span style="color: #0000ff">="org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                    true<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff"></</span><span style="color: #800000">prop</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"></</span><span style="color: #800000">props</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #008000"><!--</span><span style="color: #008000"> 瑙﹀彂鍣?鍙互鏀句竴澶у爢瑙﹀彂鍣?nbsp;</span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="triggers"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"><</span><span style="color: #800000">list</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #008000"><!--</span><span style="color: #008000"> 鍦ㄨ繖閲屽姞 </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                 </span><span style="color: #0000ff"><</span><span style="color: #800000">ref </span><span style="color: #ff0000">bean</span><span style="color: #0000ff">="mainTrigger"</span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff"></</span><span style="color: #800000">list</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">bean</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">beans</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> <img src ="http://www.tkk7.com/alexwan/aggbug/207241.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-06-11 23:21 <a href="http://www.tkk7.com/alexwan/archive/2008/06/11/207241.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浣跨敤eclipse鐢熸垚鏂囨。錛坖avadoc錛?http://www.tkk7.com/alexwan/archive/2008/06/07/206478.htmlAlexwanAlexwanSat, 07 Jun 2008 02:26:00 GMThttp://www.tkk7.com/alexwan/archive/2008/06/07/206478.htmlhttp://www.tkk7.com/alexwan/comments/206478.htmlhttp://www.tkk7.com/alexwan/archive/2008/06/07/206478.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/206478.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/206478.html 1錛屽湪欏圭洰鍒楄〃涓寜鍙抽敭錛岄夋嫨Export錛堝鍑猴級錛岀劧鍚庡湪Export(瀵煎嚭)瀵硅瘽妗嗕腑閫夋嫨java涓嬬殑javadoc錛屾彁浜ゅ埌涓嬩竴姝ャ?br /> 鍦↗avadoc Generation瀵硅瘽妗嗕腑鏈変袱涓湴鏂硅娉ㄦ剰鐨勶細
javadoc command:搴旇閫夋嫨jdk鐨刡in/javadoc.exe
destination:涓虹敓鎴愭枃妗g殑淇濆瓨璺緞錛屽彲鑷敱閫夋嫨銆?br /> 鎸塮inish(瀹屾垚)鎻愪氦鍗沖彲寮濮嬬敓鎴愭枃妗c?br /> 2錛岀敤鑿滃崟閫夋嫨錛欶ile->Export(鏂囦歡錛?gt;瀵煎嚭)錛?br /> 鍓╀笅鐨勬楠ゅ拰絎竴縐嶆柟娉曟槸涓鏍風殑銆?br /> 3錛岄変腑瑕佺敓鎴愭枃妗g殑欏圭洰錛岀劧鍚庣敤鑿滃崟閫夋嫨錛?br /> Project->Generate Javadoc鐩存帴榪涘叆Javadoc Generation瀵硅瘽妗嗭紝鍓╀綑鐨勬楠ゅ氨鍜岀涓縐嶆柟娉曞湪Javadoc Generation瀵硅瘽妗嗗紑濮嬫槸涓鏍風殑銆?nbsp;

Alexwan 2008-06-07 10:26 鍙戣〃璇勮
]]>
Velocity璇硶 http://www.tkk7.com/alexwan/archive/2008/06/07/206473.htmlAlexwanAlexwanSat, 07 Jun 2008 02:18:00 GMThttp://www.tkk7.com/alexwan/archive/2008/06/07/206473.htmlhttp://www.tkk7.com/alexwan/comments/206473.htmlhttp://www.tkk7.com/alexwan/archive/2008/06/07/206473.html#Feedback1http://www.tkk7.com/alexwan/comments/commentRss/206473.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/206473.html闃呰鍏ㄦ枃

Alexwan 2008-06-07 10:18 鍙戣〃璇勮
]]>
velocity寮鍙戞彃浠?http://www.tkk7.com/alexwan/archive/2008/06/07/206472.htmlAlexwanAlexwanSat, 07 Jun 2008 02:16:00 GMThttp://www.tkk7.com/alexwan/archive/2008/06/07/206472.htmlhttp://www.tkk7.com/alexwan/comments/206472.htmlhttp://www.tkk7.com/alexwan/archive/2008/06/07/206472.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/206472.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/206472.htmlveloeclipse
http://propsorter.sourceforge.net/veloeclipse

Properties Editor

http://propedit.sourceforge.jp/eclipse/updates/ 



Alexwan 2008-06-07 10:16 鍙戣〃璇勮
]]>
鍏充簬cas鍘熺悊 http://www.tkk7.com/alexwan/archive/2008/06/07/206461.htmlAlexwanAlexwanSat, 07 Jun 2008 01:19:00 GMThttp://www.tkk7.com/alexwan/archive/2008/06/07/206461.htmlhttp://www.tkk7.com/alexwan/comments/206461.htmlhttp://www.tkk7.com/alexwan/archive/2008/06/07/206461.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/206461.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/206461.htmlfrom:http://www.javaeye.com/topic/21770?page=3

CAS鐢ㄦ潵鏍囧織鐢ㄦ埛鐨則oken鏄瓨鍦ㄥ畠鑷繁鐨勫煙鍚嶄笅鐨?涓嶆槸瀛樺湪web搴旂敤鐨勫煙鍚嶄笅鐨?CAS鍒ゆ柇鐢ㄦ埛鐧誨綍鐢盿gent鍐沖畾,agent楠岃瘉鐢ㄦ埛淇℃伅鏈変袱縐嶅鐞?
1.濡傛灉榪欎釜鐢ㄦ埛鏄互鍓嶆病鐧誨綍榪囩殑,涔熷氨鏄榪欎釜web搴旂敤鐨勫煙鍚嶄笅娌℃湁涓涓猘gent棰佸彂鐨剆essionid(鍦╟ookie閲?鐨勮瘽,閭d箞瀹冧細璺寵漿鍒癈AS server鐨勭櫥褰曠晫闈?榪欓噷鐢盋AS server鍐沖畾鏄惁鏄劇ず鐧誨綍鐣岄潰,榪樻槸鐩存帴灝辮煩杞洖鏉?涔熷氨鏄笉鏄瘡嬈¢兘瑕佹眰杈撳叆瀵嗙爜鐧誨綍鐨?.
2.CAS鐨勭櫥褰曠晫闈細鏈変袱縐嶅鐞?濡傛灉浠ュ墠娌$櫥褰曡繃,涔熷氨鏄湪CAS server鑷繁鐨勫煙鍚嶄笅,娌℃湁鐢ㄦ埛鐨則oken鐨勮瘽,灝辮姹傜櫥褰?濡傛灉鏈塼oken鐨勮瘽,灝辮繑鍥炰竴涓猼icket(涔熷氨鏄笉鏄劇ず鐧誨綍鐣岄潰鐩存帴閲嶅畾鍚戣繑鍥炰簡).
鐒跺悗鎺ョ涓姝ラ噷闈?agent鏀跺埌ticket浠ュ悗灝辨彁浜ょ粰CAS server楠岃瘉,騫跺彇寰楄繑鍥炰俊鎭?鏄釜xml,cas鐨勫崗璁瀹氱殑,涔熷彲浠ョ敤saml涔嬬被鐨?榪欎釜鍦版柟鍙互鍙栧緱闄や簡鐢ㄦ埛濮撳悕浠ュ鐨勪俊鎭?榪欐牱灝卞彲浠ュ仛鍚屾浜?鏉冮檺鐨勯棶棰樺彲浠ヨ繖涔堣В鍐?.鐒跺悗agent灝變繚瀛樻鏃剁殑session,鎶妔essionid鏀懼埌璇eb搴旂敤鍩熷悕涓嬬殑cookie閲?
浠ヤ笂閫昏緫璇存槑浜?鏍囧織鐢ㄦ埛韜喚鐨則oken鍦–AS server鐨勫煙鍚嶄笅,姣忎釜web搴旂敤涓嶄繚瀛樼敤鎴瘋韓浠?鍥犳璺ㄥ煙鏄粷瀵規病闂鐨?鍙槸single sign off灝遍渶瑕丆AS server鐨勯厤鍚堜簡,瑕佹妸閭d釜token鍒犳帀.
涓嶈繃濡傛灉鏍囧織韜喚鐨則oken涓嶅瓨鍦?鑰宻essionid瀛樺湪,閭h繕鏄璁や負鏄櫥褰曠殑,鍙笉榪囨槸鍦ㄧ瓑寰呴偅涓猻ession timeout鑰屽凡.



Alexwan 2008-06-07 09:19 鍙戣〃璇勮
]]>
cas鐧婚檰楠岃瘉嫻佺▼鍥?/title><link>http://www.tkk7.com/alexwan/archive/2008/06/07/206460.html</link><dc:creator>Alexwan</dc:creator><author>Alexwan</author><pubDate>Sat, 07 Jun 2008 01:18:00 GMT</pubDate><guid>http://www.tkk7.com/alexwan/archive/2008/06/07/206460.html</guid><wfw:comment>http://www.tkk7.com/alexwan/comments/206460.html</wfw:comment><comments>http://www.tkk7.com/alexwan/archive/2008/06/07/206460.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/alexwan/comments/commentRss/206460.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/alexwan/services/trackbacks/206460.html</trackback:ping><description><![CDATA[<img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/alexwan/cas鏈嶅姟绔祦紼媉gif_1.gif" /><br /> <p>鍥劇墖涓殑瀛椾綋紼嶅井灝忎簡鐐?鍛靛懙,浣跨敤visio鎴戣繕綆楁槸涓柊鎵? </p> <p>ps:榪欎釜嫻佺▼鍥炬槸鏍規嵁cas鏈嶅姟绔殑webflow鐨勯厤緗敾鍑烘潵,濡傛湁鏈漢鏈夌悊瑙i敊璇殑!嬈㈣繋鎸囨!</p> <img src ="http://www.tkk7.com/alexwan/aggbug/206460.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/alexwan/" target="_blank">Alexwan</a> 2008-06-07 09:18 <a href="http://www.tkk7.com/alexwan/archive/2008/06/07/206460.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>PATTERN FORMATS GLOSSARY for log4j http://www.tkk7.com/alexwan/archive/2008/06/07/206458.htmlAlexwanAlexwanSat, 07 Jun 2008 01:10:00 GMThttp://www.tkk7.com/alexwan/archive/2008/06/07/206458.htmlhttp://www.tkk7.com/alexwan/comments/206458.htmlhttp://www.tkk7.com/alexwan/archive/2008/06/07/206458.html#Feedback0http://www.tkk7.com/alexwan/comments/commentRss/206458.htmlhttp://www.tkk7.com/alexwan/services/trackbacks/206458.htmlFrom :http://topic.csdn.net/t/20040706/20/3151154.html

!-----------------------------------------------------------------------------!  
  !                                                     PATTERN   FORMATS   GLOSSARY                                                       !  
  !-----------------------------------------------------------------------------!  
  !   %n   -   newline                                                                                                                                 !  
  !   %m   -   your   log   message                                                                                                               !  
  !   %p   -   message   priority   (FATAL,   ERROR,   WARN,   INFO,   DEBUG   or   custom)                       !  
  !   %r   -   millisecs   since   program   started   running                                                                 !  
  !    %%  -   percent   sign   in   output                                                                                                   !  
  !                                                                                                                                                           !  
  !-----------------------SOME   MORE   CLUTTER   IN   YOUR   LOG-------------------------!  
  !   %c   -   name   of   your   category   (logger),   %c{2}   will   outputs   last   two   components   !  
  !   %t   -   name   of   current   thread                                                                                                   !  
  !   %x   -   Nested   Diagnostic   Context   (NDC)   (you   supply   it!)                                               !  
  !                                                                                                                                                           !  
  !-------------------------SLOW   PERFORMANCE   FORMATS----------------------------!  
  !   %d   -   date   and   time,   also   %d{ISO8601},   %d{DATE},   %d{ABSOLUTE},                               !  
  !                 %d{HH:mm:ss,SSS},   %d{dd   MMM   yyyy   HH:mm:ss,SSS}   and   so   on                           !  
  !   %l   -   Shortcut   for   %F%L%C%M                                                                                                     !  
  !   %F   -   Java   source   file   name                                                                                                     !  
  !   %L   -   Java   source   line   number                                                                                                 !  
  !   %C   -   Java   class   name,   %C{1}   will   output   the   last   one   component                             !  
  !   %M   -   Java   method   name                                                                                                               !  
  !                                                                                                                                                           !  
  !------------------------------FORMAT   MODIFIERS-------------------------------!  
  !   %-any_letter_above   -   Left-justify   in   min.   width   (default   is   right-justify)     !  
  !   %20any_letter_above   -   20   char.   min.   width   (pad   with   spaces   if   reqd.)                 !  
  !   %.30any_letter_above   -   30   char.   max.   width   (truncate   beginning   if   reqd.)         !  
  !   %-10.10r   -   Example.     Left-justify   time   elapsed   within   10-wide   field.                 !  
  !                             Truncate   from   beginning   if   wider   than   10   characters.                       !  
  !-----------------------------------------------------------------------------!  



Alexwan 2008-06-07 09:10 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲人成人无码网www电影首页| 国产情侣久久久久aⅴ免费| 国产精品色午夜视频免费看| 亚洲AV无码之国产精品| 永久免费bbbbbb视频| a一级爱做片免费| 久久精品九九亚洲精品| 国产成人免费爽爽爽视频 | 宅男666在线永久免费观看| 又大又硬又粗又黄的视频免费看 | 亚洲国产成人影院播放| 国产麻豆成人传媒免费观看| 亚洲欧洲日韩极速播放| 亚洲日韩国产成网在线观看| 97在线视频免费播放| 亚洲精品天堂无码中文字幕| 国产专区一va亚洲v天堂| 亚色九九九全国免费视频| 成年网在线观看免费观看网址| 亚洲午夜在线电影| 国产一区二区三区免费看| 99精品免费观看| 日韩久久无码免费毛片软件| 亚洲成人高清在线观看| 女人18毛片水真多免费看| 无套内谢孕妇毛片免费看看| 亚洲精品亚洲人成在线观看麻豆 | 亚洲国产精品精华液| 久久青草亚洲AV无码麻豆| 啊v在线免费观看| 性短视频在线观看免费不卡流畅| 99麻豆久久久国产精品免费| 亚洲一本一道一区二区三区| 亚洲精品成人片在线观看精品字幕 | 亚洲av色福利天堂| 亚洲Aⅴ无码一区二区二三区软件 亚洲AⅤ视频一区二区三区 | 在线播放国产不卡免费视频| 久久久久精品国产亚洲AV无码| 亚洲精品无码久久一线| 免费jjzz在在线播放国产| 99爱在线精品免费观看|