锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲视频网站在线观看,亚洲熟妇无码av另类vr影视 ,日产亚洲一区二区三区http://www.tkk7.com/luckyrobbie/<font size=-1>JAVA鏄摑鑹茬殑-</font> <!-- Start FastOnlineUsers.com --> <a ><script type="text/javascript" src="http://fastonlineusers.com/on2.php?d=www.tkk7.com/luckyrobbie"></script> online</a><!-- End FastOnlineUsers.com -->zh-cnSat, 10 May 2025 19:04:41 GMTSat, 10 May 2025 19:04:41 GMT60綺懼僵鐨勨滃叚涓鈥?/title><link>http://www.tkk7.com/luckyrobbie/archive/2006/06/12/52195.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Mon, 12 Jun 2006 06:05:00 GMT</pubDate><guid>http://www.tkk7.com/luckyrobbie/archive/2006/06/12/52195.html</guid><wfw:comment>http://www.tkk7.com/luckyrobbie/comments/52195.html</wfw:comment><comments>http://www.tkk7.com/luckyrobbie/archive/2006/06/12/52195.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/luckyrobbie/comments/commentRss/52195.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/luckyrobbie/services/trackbacks/52195.html</trackback:ping><description><![CDATA[ <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%"> <span style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%"> <span style="mso-tab-count: 1">聽聽聽</span> </span>璐濊礉鍦ㄥ疁鍩庝腑蹇冨辜鍎垮洯鐨勭涓涓滃叚涓鈥濆浗闄呭効绔ヨ妭緇堜簬鏉ュ埌浜嗭紝榪欏浜庢垜浠叏瀹舵潵璇村彲鏄竴涓ぇ鏃ュ瓙銆傛棭涓婅搗鏉ワ紝璐濊礉鍗存湁鐐規媴蹇冩垜浠笉闄粬涓璧峰弬鍔犲辜鍎垮洯鐨勫簡紲濇椿鍔紝浠庤屾祦闇插嚭涓涓濈劍铏戙傚叾瀹炴垜浠墠涓嶄細閿欒繃榪欎釜闅懼緱鐨勬満浼氬憿錛屾洿浣曞喌鐖哥埜濡堝鍜岃礉璐濅竴璧峰噯澶囩殑姝岃垶鈥滃皬嫻峰啗鈥濓紝涔熷皢鍦ㄤ粖澶╃殑搴嗙媧誨姩涓竴璧蜂寒鐩稿憿銆?/span> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%"> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%"> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%"> <span style="mso-tab-count: 1">聽聽聽聽聽聽 </span> </span> <span style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鏃╀笂涔濈偣錛屾垜浠噯鏃舵潵鍒板辜鍎垮洯銆備綔涓哄皬鏈嬪弸浠殑涔愬洯錛岃繖閲屾姝岀瑧璇紝寮犵伅緇撳僵錛屽澶勬磱婧㈢潃鍎跨鑺傜殑嬈㈠揩姘旀皼錛岃礉璐濅篃寰堝揩灝辮瀺鍏ュ埌鑺傛棩鐨勬皼鍥翠箣涓簡銆?/span> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%"> <span style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鍦??xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /?><st1:personname w:st="on" productid="闄?>闄?/st1:personname>鑰?st1:personname w:st="on" productid="甯堝拰娼?>甯堝拰娼?/st1:personname>鑰佸笀浜曠劧鏈夊簭鐨勫畨鎺掍笅錛屽皬涓鐝殑搴嗙媧誨姩寮濮嬩簡銆傚皬鏈嬪弸浠垎緇勮〃婕斾簡鍎挎瓕鍜岀璋c傝疆鍒拌礉璐濊繖涓緇勫紑濮嬭〃婕斾簡錛屾垜浠刀蹇噯澶囨媿鐓у拰鎽勫儚錛屼竴瀹氳鎶婅繖綺懼僵鐨勭灛闂存崟鎹夎褰曚笅鏉ャ傗?/span> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%">鈥?/span> <span style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鍏浮姣忓ぉ鏃╂棭璧鳳紝姣嶉浮鐢熻泲瀛靛皬楦?/span> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%">鈥︹?/span> <span style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">錛屽皬鏈嬪弸浠姳鏈佃埇騫煎鐨勬瓕鍠変即闅忕潃鍙埍鐨勮垶韞堝姩浣滃惛寮曚簡鍦ㄥ満鐨勬瘡涓浣嶅闀褲傚綋鎴戜滑榪橀兘娌夋蹈鍦ㄥ垰鎵嶇簿褰╃殑騫煎効姝岃垶琛ㄦ紨鏃訛紝瀹墮暱浠殑瓚e懗娓告垙鈥滄按鏋滆共鈥濆紑濮嬩簡錛屾垜鍜岃礉璐濆濡堜篃縐瀬鍙備笌浜嗚繖涓父鎴忋傚闀夸滑鐨勮〃鐜拌灝忔湅鍙嬩滑蹇嶄繆涓嶆錛屸滃挴鍜挴</span> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%">鈥?/span> <span style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鍜挴鍜濓紝涓涓蹭覆鐨勭瑧澹版覆鏌撲簡姣忎竴浣嶅ぇ浜哄拰灝忔湅鍙嬨?/span> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%"> <span style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">璐濊礉浠婂ぉ鐨勮〃鐜板緢媯掞紝褰?st1:personname w:st="on" productid="闄?>闄?/st1:personname>鑰佸笀璇磋璐濊礉瀹跺涵琛ㄦ紨姝岃垶鈥滃皬嫻峰啗鈥濇椂錛屼粬寰堝揩灝卞ぇ澶ф柟鏂瑰湴璺戝埌鑸炲彴涓ぎ錛屽0闊沖搷浜紝鍜岀埜鐖鎬竴璧峰敱璧峰皬嫻峰啗榪欓鍎挎瓕錛屽悓鏃跺姩浣滄祦鐣咃紝鍜屽濡堜竴璧瘋煩鐫鑸炶箞錛屽紑寮蹇冨績鍦板畬鎴愪簡榪欎釜鑺傜洰錛岃耽寰椾簡澶у鐨勪竴鐗囨帉澹般傛垜浠竴鐩撮兘寰堢弽鎯滀笌璐濊礉涓鍚屽弬鍔犻泦浣撴椿鍔ㄧ殑鏈轟細錛屽洜姝ゅ績涓挨涓轟互榪欐鍦ㄥ辜鍎垮洯閲屽拰璐濊礉涓璧峰悓鍙拌〃婕旇屾劅鍒伴珮鍏淬傛帴涓嬫潵錛屽叾浠栫殑瀹跺涵涔熼兘琛ㄦ紨浜嗗悇鑷簿褰╃殑鑺傜洰錛屾湁璁叉晠浜嬨侀挗鐞寸嫭濂忋佸弻綈э紝榪樻湁欖旀湳錛屼紬褰╃悍鍛堢殑鑺傜洰鎶婅繖嬈℃椿鍔ㄧ殑姘旀皼鎺ㄥ悜楂樻疆銆備互鑷充簬媧誨姩钀戒笅甯峰箷鏃訛紝瀹墮暱鍜屽皬鏈嬪弸浠兘榪樻亱鎭嬩笉鑸嶅憿銆?/span> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%"> <span style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鍥炲鍚庯紝璐濊礉韞﹁功璺寵煩錛屼笉鏃跺敱鐫鍎挎瓕錛屼技涔庤繕瀵逛粖澶╃殑媧誨姩鎰忕姽鏈敖銆傗滃叚涓鈥濆効绔ヨ妭錛屾垜浠叏瀹惰繃寰楀紑蹇冭屾湁鎰忎箟銆傞氳繃榪欐媧誨姩澧炲己浜嗚礉璐濆湪闆嗕綋媧誨姩涓殑鑷俊蹇冨拰璐d換鎰燂紝鍚屾椂涔熷姞寮轟簡鎴戜滑鍜?span style="COLOR: black">璐濊礉涔嬮棿鐨勪簰鍔ㄤ綋楠屻?/span></span> <span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 150%"> <o:p> </o:p> </span> </p> <img src ="http://www.tkk7.com/luckyrobbie/aggbug/52195.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-06-12 14:05 <a href="http://www.tkk7.com/luckyrobbie/archive/2006/06/12/52195.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瓚h瘽涓夊垯http://www.tkk7.com/luckyrobbie/archive/2006/04/23/42616.htmlluckyrobbieluckyrobbieSun, 23 Apr 2006 03:02:00 GMThttp://www.tkk7.com/luckyrobbie/archive/2006/04/23/42616.htmlhttp://www.tkk7.com/luckyrobbie/comments/42616.htmlhttp://www.tkk7.com/luckyrobbie/archive/2006/04/23/42616.html#Feedback0http://www.tkk7.com/luckyrobbie/comments/commentRss/42616.htmlhttp://www.tkk7.com/luckyrobbie/services/trackbacks/42616.html鏃╀笂錛岃礉璐濈珯鍦ㄦ垜鐨勬懇鎵樿濺韙忔澘涓婏紝鎴戦佷粬鍘誨辜鍎垮洯銆傚紑鍒皉oundabout鐨勫湴鏂規椂錛岃礉璐濊錛氱埜鐖稿氨寮榪欎釜娓╁害鍚с?鎴戦棶錛氫粈涔堬紵 璐濊礉璇達細鏄熷害錛屼笉瑕佸啀鍔犻熷害浜嗐?br />
2
璐濊礉鍠滄鎵撶數鑴戞父鎴忥紝鍓嶅嚑澶╃壒鍒枩嬈㈢帺涓涓搯鍟姊﹂挀楸肩殑flash娓告垙錛屽鏋滀笉灝忓績浼氶挀鍒伴波楸鹼紝鑰屼笖鎴戜滑涓嶈浠栧鐜┿備竴澶╄礉璐濈潯瑙夊仛姊﹁屽ぇ鍝紝鍙啋鍚庨棶浠栧仛鍒頒粈涔堟ⅵ浜嗭紝浠栬錛氱埜鐖鎬笉璁╂垜鐜╅挀楸鹼紝鑰屼笖閽撳埌浜嗛波楸兼妸灝忕尗鍚冩帀浜嗐?br />
3
鏅氫笂鍚冩ū妗冿紝璐濊礉鍚冪殑寰堝紑蹇冿紝榪樻寫鍑虹孩鐨勭粰鎴戝悆銆傛垜瀵硅礉璐濊錛氭寫1綺掔粰濡堝鍚冨悆錛屽幓鎷嶆媿濂圭殑椹眮銆備簬鏄礉璐濋変簡涓涓孩鐨勬ū妗冿紝璺戝埌濡堝杈逛笂璇達細濡堝錛屽枏錛屽悆涓┈灞併?img src ="http://www.tkk7.com/luckyrobbie/aggbug/42616.html" width = "1" height = "1" />

luckyrobbie 2006-04-23 11:02 鍙戣〃璇勮
]]>
Hibernate瀛︿範(1)http://www.tkk7.com/luckyrobbie/archive/2006/04/18/41660.htmlluckyrobbieluckyrobbieTue, 18 Apr 2006 07:53:00 GMThttp://www.tkk7.com/luckyrobbie/archive/2006/04/18/41660.htmlhttp://www.tkk7.com/luckyrobbie/comments/41660.htmlhttp://www.tkk7.com/luckyrobbie/archive/2006/04/18/41660.html#Feedback0http://www.tkk7.com/luckyrobbie/comments/commentRss/41660.htmlhttp://www.tkk7.com/luckyrobbie/services/trackbacks/41660.html1. 鍩熸ā鍨嬩篃縐頒負璁捐妯″瀷錛岀敱浠ヤ笅鍐呭緇勬垚錛?br />聽聽聽 鍏鋒湁鐘舵佸拰琛屼負鐨勫煙瀵硅薄
聽聽聽 鍩熷璞′箣闂寸殑鍏崇郴

2. 鍩熷璞?Domain Object) - 瀵圭湡瀹炰笘鐣岀殑瀹炰綋鐨勮蔣浠舵娊璞★紝涔熷彨涓氬姟瀵硅薄(Business Object)錛屽垎涓猴細
聽聽聽聽瀹炰綋鍩熷璞?瀹炰綋EJB錛孭OJO)錛屼負姣忎釜瀹炰綋鍩熷璞″垎閰峅ID(Object Identifier)
聽聽聽聽榪囩▼鍩熷璞?Session Bean, Message Driven Bean, Java Bean)
聽聽聽 浜嬩歡鍩熷璞?浜嬩歡瑙﹀彂)
聽 涓夌鍩熷璞′綅浜庝笟鍔¢昏緫灞?br />
3. 鍩熷璞′箣闂寸殑鍏崇郴
聽聽聽 鍏寵仈(Association)錛歰ne to one, one to many, many to many, 鍗曞悜, 鍙屽悜
聽聽聽 渚濊禆(Dependency)錛氱被涓庣被涔嬮棿鐨勮闂叧緋伙紝濡傛灉A璁塊棶B鐨勫睘鎬ф垨鑰呮柟娉曪紝鎴栬匒璐熻矗瀹炰緥鍖朆錛屽垯A渚濊禆B銆傝繃紼嬪煙瀵硅薄寰寰渚濊禆瀹炰綋鍩熷璞°?br />聽聽聽聽鑱氶泦(Aggregation)錛氭暣浣撲笌閮ㄥ垎涔嬮棿鐨勫叧緋伙紝瀹炰綋鍩熷璞′箣闂村父瑙併傝仛闆嗗叧緋誨拰鍏寵仈鍏崇郴鏈夌浉鍚岀殑褰㈠紡錛屽尯鍒槸錛氬浜庤仛闆嗗叧緋伙紝閮ㄥ垎綾葷殑瀵硅薄涓嶈兘鍗曠嫭瀛樺湪錛屽畠鐨勭敓鍛藉懆鏈熶緷璧栦簬鏁翠綋綾葷殑瀵硅薄鐨勭敓鍛藉懆鏈燂紱瀵逛簬鍏寵仈鍏崇郴鐨?涓被錛屽彲浠ュ垎鍒崟鐙瓨鍦ㄣ?br />聽聽聽聽涓鑸寲(Generalization)

聽聽聽聽聽
聽聽聽



luckyrobbie 2006-04-18 15:53 鍙戣〃璇勮
]]>
鍒氬垰瑙e喅涓涓猦sqldb鐨勫垵綰ч棶棰?/title><link>http://www.tkk7.com/luckyrobbie/archive/2006/04/06/39688.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Thu, 06 Apr 2006 14:32:00 GMT</pubDate><guid>http://www.tkk7.com/luckyrobbie/archive/2006/04/06/39688.html</guid><wfw:comment>http://www.tkk7.com/luckyrobbie/comments/39688.html</wfw:comment><comments>http://www.tkk7.com/luckyrobbie/archive/2006/04/06/39688.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/luckyrobbie/comments/commentRss/39688.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/luckyrobbie/services/trackbacks/39688.html</trackback:ping><description><![CDATA[ <p>榪?澶╃敤hsqldb鍋歨ibernate嫻嬭瘯錛屽仛insert鏃訛紝涓嶈鐢╤ibernate鐨勬柟娉曡繕鏄敤jdbc鐨勬柟娉曪紝鏄劇ず鐨勪竴鍒囦俊鎭兘鏄垚鍔熺殑錛屽彲鏄悗鏉ユ墦寮hsqldb鐨刴anager錛屽彂鐜皌able閲岄潰娌℃湁璁板綍insert錛?img height="20" src="http://www.tkk7.com/Emoticons/QQ/12.gif" width="20" border="0" />閮侀椃涔嬫瀬錛岃寰楀簲璇ユ槸hsqldb鐨勯厤緗棶棰?br /><br />浜庢槸鎵撳紑閭d釜script鏂囦歡錛屾渶鍚庢壘鍒拌繖鍙ラ厤緗細SET WRITE_DELAY 20<br />鏀逛負SET WRITE_DELAY 0鍚庯紝涓鍒囨甯鎬簡<img height="19" src="http://www.tkk7.com/Emoticons/QQ/22.gif" width="19" border="0" /></p> <img src ="http://www.tkk7.com/luckyrobbie/aggbug/39688.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-04-06 22:32 <a href="http://www.tkk7.com/luckyrobbie/archive/2006/04/06/39688.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>msdn涓浜庢鍒欒〃杈懼紡鐨勪粙緇?/title><link>http://www.tkk7.com/luckyrobbie/archive/2006/03/30/38210.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Thu, 30 Mar 2006 03:05:00 GMT</pubDate><guid>http://www.tkk7.com/luckyrobbie/archive/2006/03/30/38210.html</guid><wfw:comment>http://www.tkk7.com/luckyrobbie/comments/38210.html</wfw:comment><comments>http://www.tkk7.com/luckyrobbie/archive/2006/03/30/38210.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/luckyrobbie/comments/commentRss/38210.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/luckyrobbie/services/trackbacks/38210.html</trackback:ping><description><![CDATA[ <div> <a > <font color="#004377">http://msdn.microsoft.com/library/CHS/jscript7/html/jsreconIntroductionToRegularExpressions.asp?frame=true</font> </a> </div> <img src ="http://www.tkk7.com/luckyrobbie/aggbug/38210.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-03-30 11:05 <a href="http://www.tkk7.com/luckyrobbie/archive/2006/03/30/38210.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鐢╠ecorate妯″紡鐢諱竴寮犵敾http://www.tkk7.com/luckyrobbie/archive/2006/03/27/37638.htmlluckyrobbieluckyrobbieMon, 27 Mar 2006 08:56:00 GMThttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37638.htmlhttp://www.tkk7.com/luckyrobbie/comments/37638.htmlhttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37638.html#Feedback0http://www.tkk7.com/luckyrobbie/comments/commentRss/37638.htmlhttp://www.tkk7.com/luckyrobbie/services/trackbacks/37638.html鎴戝decorate妯″紡鐨勭悊瑙o細
1-棣栧厛瑕佹湁涓涓狪nterface錛屾彁渚涗竴涓氱敤鐨勬柟娉曪紱
2-鍏舵鏈塶澶氫釜class鏉ュ疄鐜拌繖涓帴鍙d腑鐨勬柟娉曪紝榪欎簺瀹炵幇鏂規硶鍦ㄥ姛鑳戒笂搴旇鏄茍鍒楃殑錛屼絾涓嶆槸蹇呴』鐨勶紝浠庤屽彲浠ユ牴鎹渶瑕乨ecorate閭d釜闇瑕佽淇グ鐨勫垵濮嬪璞°?br />3-鏈鍚庤繖浜沜lass閮芥湁涓涓甫鏈塈nterface浣滀負鍙傛暟鐨勬瀯閫犳柟娉曞拰涓涓狪nterface鐨勫睘鎬э紝榪欐牱鍦ㄦ瀯閫犵殑鏃跺欏氨鍙互鍙栧緱閭d釜闇瑕佷慨楗扮殑瀵硅薄鐨勫疄渚嬶紝鐒跺悗鍦ㄥ疄鐜癐nterface鐨勬柟娉曢噷闈紝棣栧厛瀹炵幇淇グ瀵硅薄瀹炰緥鐨勪慨楗版柟娉曪紝鐒跺悗鍐嶈繘琛岃嚜宸辯殑decorate鏂規硶銆?br />
鏍規嵁榪欎釜鎯蟲硶鏉ョ敾涓寮犵敾錛?/p>
package 聽test;

public interface 聽Painting聽 {
聽聽聽聽
public void 聽paint();
}


class 聽SunPainting聽 implements 聽Painting聽 {
聽聽聽聽Painting聽painting聽
= null ;

聽聽聽聽
public 聽SunPainting()聽 {
聽聽聽聽}


聽聽聽聽
public 聽SunPainting(Painting聽painting)聽 {
聽聽聽聽聽聽聽聽
this .painting聽 = 聽painting;
聽聽聽聽}


聽聽聽聽
public void 聽paint()聽 {
聽聽聽聽聽聽聽聽
if 聽(painting聽 != null )聽 {
聽聽聽聽聽聽聽聽聽聽聽聽painting.paint();
聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽System.out.println(
" 鐢諱簡涓涓お闃?img src="http://www.tkk7.com/images/dot.gif" /> " );
聽聽聽聽}

}


class 聽CloudPainting聽 implements 聽Painting聽 {
聽聽聽聽Painting聽painting聽
= null ;

聽聽聽聽
public 聽CloudPainting()聽 {
聽聽聽聽}


聽聽聽聽
public 聽CloudPainting(Painting聽painting)聽 {
聽聽聽聽聽聽聽聽
this .painting聽 = 聽painting;
聽聽聽聽}


聽聽聽聽
public void 聽paint()聽 {
聽聽聽聽聽聽聽聽
if 聽(painting聽 != null )聽 {
聽聽聽聽聽聽聽聽聽聽聽聽painting.paint();
聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽System.out.println(
" 鐢諱簡涓鏈電櫧浜?img src="http://www.tkk7.com/images/dot.gif" /> " );
聽聽聽聽}

}


class 聽LawnPainting聽 implements 聽Painting聽 {
聽聽聽聽Painting聽painting聽
= null ;

聽聽聽聽
public 聽LawnPainting()聽 {
聽聽聽聽}


聽聽聽聽
public 聽LawnPainting(Painting聽painting)聽 {
聽聽聽聽聽聽聽聽
this .painting聽 = 聽painting;
聽聽聽聽}


聽聽聽聽
public void 聽paint()聽 {
聽聽聽聽聽聽聽聽
if 聽(painting聽 != null )聽 {
聽聽聽聽聽聽聽聽聽聽聽聽painting.paint();
聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽System.out.println(
" 鐢諱簡涓鐗囪崏鍦?img src="http://www.tkk7.com/images/dot.gif" /> " );
聽聽聽聽}

}

鍐嶅啓孌墊祴璇曠敾鐢葷殑浠g爜:

package 聽test;

public class 聽TestPainting聽 {
聽聽聽聽
public static void 聽main(String[]聽args) {
聽聽聽聽聽聽聽聽
new 聽SunPainting( new 聽CloudPainting( new 聽LawnPainting())).paint();
聽聽聽聽}

}

嫻嬭瘯緇撴灉:

鐢諱簡涓鐗囪崏鍦?img src="http://www.tkk7.com/images/dot.gif" />
鐢諱簡涓鏈電櫧浜?img src="http://www.tkk7.com/images/dot.gif" />
鐢諱簡涓涓お闃?img src="http://www.tkk7.com/images/dot.gif" />


鏈鍚庢湁涓棶棰橈細涓轟粈涔堜笉鐩存帴瀹氫箟涓涓敾鐢葷殑綾伙紝鐒跺悗鎶婅繖浜涜鎬庝箞鐢葷殑浜嬫儏鍒嗗埆閫氳繃鏂規硶鏉ュ疄鐜板憿錛?閭d箞浠涔堟儏鍐典笅浣跨敤decorate妯″紡鏇翠負鍚堥傚憿錛?/font>



]]>
鐢ㄥ叚澶т唬鐮侀棶棰樻楠屼綘鐨凧ava鐭ヨ瘑鑳藉姏http://www.tkk7.com/luckyrobbie/archive/2006/03/27/37553.htmlluckyrobbieluckyrobbieMon, 27 Mar 2006 02:17:00 GMThttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37553.htmlhttp://www.tkk7.com/luckyrobbie/comments/37553.htmlhttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37553.html#Feedback0http://www.tkk7.com/luckyrobbie/comments/commentRss/37553.htmlhttp://www.tkk7.com/luckyrobbie/services/trackbacks/37553.html
聽聽聽聽聽聽聽 1 OutputStreamWriter out = ...
銆銆2 java.sql.Connection conn = ...
銆銆3 try { // 鈶?br />銆銆4 Statement stat = conn.createStatement();
銆銆5 ResultSet rs = stat.executeQuery(
銆銆6 "select uid, name from user");
銆銆7 while (rs.next())
銆銆8 {
銆銆9 out.println("ID錛? + rs.getString("uid") // 鈶?br />銆銆10 "錛屽鍚嶏細" + rs.getString("name"));
銆銆11 }
銆銆12 conn.close(); // 鈶?br />銆銆13 out.close();
銆銆14 }
銆銆15 catch(Exception ex) // 鈶?br />銆銆16 {
銆銆17 ex.printStackTrace(); // 鈶達紝鈶?br />銆銆18 }

浣滀負涓涓狫ava紼嬪簭鍛橈紝浣犺嚦灝戝簲璇ヨ兘澶熸壘鍑轟袱涓棶棰樸備絾鏄紝濡傛灉浣犱笉鑳芥壘鍑哄叏閮ㄥ叚涓棶棰橈紝璇風戶緇槄璇繪湰鏂囥?

鏈枃璁ㄨ鐨勪笉鏄疛ava寮傚父澶勭悊鐨勪竴鑸у師鍒欙紝鍥犱負榪欎簺鍘熷垯宸茬粡琚ぇ澶氭暟浜虹啛鐭ャ傛垜浠鍋氱殑鏄垎鏋愬悇縐嶅彲縐頒負鈥滃弽渚嬧濓紙anti-pattern錛夌殑榪濊儗浼樼緙栫爜瑙勮寖鐨勫父瑙佸潖涔犳儻錛屽府鍔╄鑰呯啛鎮夎繖浜涘吀鍨嬬殑鍙嶉潰渚嬪瓙錛屼粠鑰岃兘澶熷湪瀹為檯宸ヤ綔涓晱閿愬湴瀵熻鍜岄伩鍏嶈繖浜涢棶棰樸?

鍙嶄緥涔嬩竴錛氫涪寮冨紓甯?

浠g爜錛?5琛?18琛屻?

榪欐浠g爜鎹曡幏浜嗗紓甯稿嵈涓嶄綔浠諱綍澶勭悊錛屽彲浠ョ畻寰椾笂Java緙栫▼涓殑鏉鎵嬨備粠闂鍑虹幇鐨勯綣佺▼搴﹀拰紲稿紼嬪害鏉ョ湅錛屽畠涔熻鍙互鍜孋/C++紼嬪簭鐨勪竴涓伓鍚嶈繙鎾殑闂鐩告彁騫惰??涓嶆鏌ョ紦鍐插尯鏄惁宸叉弧銆?

濡傛灉浣犵湅鍒頒簡榪欑涓㈠純錛堣屼笉鏄姏鍑猴級寮傚父鐨勬儏鍐碉紝鍙互鐧懼垎涔嬩節鍗佷節鍦拌偗瀹氫唬鐮佸瓨鍦ㄩ棶棰橈紙鍦ㄦ瀬灝戞暟鎯呭喌涓嬶紝榪欐浠g爜鏈夊瓨鍦ㄧ殑鐞嗙敱錛屼絾鏈濂藉姞涓婂畬鏁寸殑娉ㄩ噴錛屼互鍏嶅紩璧峰埆浜鴻瑙o級銆?

榪欐浠g爜鐨勯敊璇湪浜庯紝寮傚父錛堝嚑涔庯級鎬繪槸鎰忓懗鐫鏌愪簺浜嬫儏涓嶅鍔蹭簡錛屾垨鑰呰鑷沖皯鍙戠敓浜嗘煇浜涗笉瀵誨父鐨勪簨鎯咃紝鎴戜滑涓嶅簲璇ュ紼嬪簭鍙戝嚭鐨勬眰鏁戜俊鍙蜂繚鎸佹矇榛樺拰鏃犲姩浜庤》銆傝皟鐢ㄤ竴涓媝rintStackTrace綆椾笉涓娾滃鐞嗗紓甯糕濄?

涓嶉敊錛岃皟鐢╬rintStackTrace瀵硅皟璇曠▼搴忔湁甯姪錛屼絾紼嬪簭璋冭瘯闃舵緇撴潫涔嬪悗錛宲rintStackTrace灝變笉搴斿啀鍦ㄥ紓甯稿鐞嗘ā鍧椾腑鎷呰礋涓昏璐d換浜嗐?

涓㈠純寮傚父鐨勬儏褰㈤潪甯告櫘閬嶃傛墦寮JDK鐨凾hreadDeath綾葷殑鏂囨。錛屽彲浠ョ湅鍒頒笅闈㈣繖孌佃鏄庯細鈥滅壒鍒湴錛岃櫧鐒跺嚭鐜癟hreadDeath鏄竴縐嶁樻甯哥殑鎯呭艦鈥欙紝浣員hreadDeath綾繪槸Error鑰屼笉鏄疎xception鐨勫瓙綾伙紝鍥犱負璁稿搴旂敤浼氭崟鑾鋒墍鏈夌殑Exception鐒跺悗涓㈠純瀹冧笉鍐嶇悊鐫?

鈥濊繖孌佃瘽鐨勬剰鎬濇槸錛岃櫧鐒禩hreadDeath浠h〃鐨勬槸涓縐嶆櫘閫氱殑闂錛屼絾閴翠簬璁稿搴旂敤浼氳瘯鍥炬崟鑾鋒墍鏈夊紓甯哥劧鍚庝笉浜堜互閫傚綋鐨勫鐞嗭紝鎵浠DK鎶奣hreadDeath瀹氫箟鎴愪簡Error鐨勫瓙綾伙紝鍥犱負Error綾諱唬琛ㄧ殑鏄竴鑸殑搴旂敤涓嶅簲璇ュ幓鎹曡幏鐨勪弗閲嶉棶棰樸傚彲瑙侊紝涓㈠純寮傚父榪欎竴鍧忎範鎯槸濡傛甯歌錛屽畠鐢氳嚦宸茬粡褰卞搷鍒頒簡Java鏈韓鐨勮璁°?

閭d箞錛屽簲璇ユ庢牱鏀規鍛紵涓昏鏈夊洓涓夋嫨錛?

1銆佸鐞嗗紓甯搞傞拡瀵硅寮傚父閲囧彇涓浜涜鍔紝渚嬪淇闂銆佹彁閱掓煇涓漢鎴栬繘琛屽叾浠栦竴浜涘鐞嗭紝瑕佹牴鎹叿浣撶殑鎯呭艦紜畾搴旇閲囧彇鐨勫姩浣溿傚啀嬈¤鏄庯紝璋冪敤printStackTrace綆椾笉涓婂凡緇忊滃鐞嗗ソ浜嗗紓甯糕濄?

2銆侀噸鏂版姏鍑哄紓甯搞傚鐞嗗紓甯哥殑浠g爜鍦ㄥ垎鏋愬紓甯鎬箣鍚庯紝璁や負鑷繁涓嶈兘澶勭悊瀹冿紝閲嶆柊鎶涘嚭寮傚父涔熶笉澶變負涓縐嶉夋嫨銆?

3銆佹妸璇ュ紓甯歌漿鎹㈡垚鍙︿竴縐嶅紓甯搞傚ぇ澶氭暟鎯呭喌涓嬶紝榪欐槸鎸囨妸涓涓綆綰х殑寮傚父杞崲鎴愬簲鐢ㄧ駭鐨勫紓甯革紙鍏跺惈涔夋洿瀹規槗琚敤鎴蜂簡瑙g殑寮傚父錛夈?

4銆佷笉瑕佹崟鑾峰紓甯搞?

緇撹涓錛氭棦鐒舵崟鑾蜂簡寮傚父錛屽氨瑕佸瀹冭繘琛岄傚綋鐨勫鐞嗐備笉瑕佹崟鑾峰紓甯鎬箣鍚庡張鎶婂畠涓㈠純錛屼笉浜堢悊鐫?

鍙嶄緥涔嬩簩錛氫笉鎸囧畾鍏蜂綋鐨勫紓甯?

浠g爜錛?5琛屻?

璁稿鏃跺欎漢浠細琚繖鏍蜂竴縐嶁滅編濡欑殑鈥濇兂娉曞惛寮曪細鐢ㄤ竴涓猚atch璇彞鎹曡幏鎵鏈夌殑寮傚父銆傛渶甯歌鐨勬儏褰㈠氨鏄嬌鐢╟atch(Exception

ex)璇彞銆備絾瀹為檯涓婏紝鍦ㄧ粷澶у鏁版儏鍐典笅錛岃繖縐嶅仛娉曚笉鍊煎緱鎻愬°備負浠涔堝憿錛?

瑕佺悊瑙e叾鍘熷洜錛屾垜浠繀欏誨洖欏句竴涓媍atch璇彞鐨勭敤閫斻俢atch璇彞琛ㄧず鎴戜滑棰勬湡浼氬嚭鐜版煇縐嶅紓甯革紝鑰屼笖甯屾湜鑳藉澶勭悊璇ュ紓甯搞傚紓甯哥被鐨勪綔鐢ㄥ氨鏄憡璇塉ava緙栬瘧鍣ㄦ垜浠兂瑕佸鐞嗙殑鏄摢涓縐嶅紓甯搞?

鐢變簬緇濆ぇ澶氭暟寮傚父閮界洿鎺ユ垨闂存帴浠巎ava.lang.Exception媧劇敓錛宑atch(Exception ex)灝辯浉褰撲簬璇存垜浠兂瑕佸鐞嗗嚑涔庢墍鏈夌殑寮傚父銆?

鍐嶆潵鐪嬬湅鍓嶉潰鐨勪唬鐮佷緥瀛愩傛垜浠湡姝f兂瑕佹崟鑾風殑寮傚父鏄粈涔堝憿錛熸渶鏄庢樉鐨勪竴涓槸SQLException錛岃繖鏄疛DBC鎿嶄綔涓父瑙佺殑寮傚父銆傚彟涓涓彲鑳界殑寮傚父鏄疘OException錛屽洜涓哄畠瑕佹搷浣淥utputStreamWriter銆?

鏄劇劧錛屽湪鍚屼竴涓猚atch鍧椾腑澶勭悊榪欎袱縐嶆埅鐒朵笉鍚岀殑寮傚父鏄笉鍚堥傜殑銆傚鏋滅敤涓や釜catch鍧楀垎鍒崟鑾稴QLException鍜孖OException灝辮濂藉浜嗐傝繖灝辨槸璇達紝catch璇彞搴斿綋灝介噺鎸囧畾鍏蜂綋鐨勫紓甯哥被鍨嬶紝鑰屼笉搴旇鎸囧畾娑電洊鑼冨洿澶箍鐨凟xception綾匯?

鍙︿竴鏂歸潰錛岄櫎浜嗚繖涓や釜鐗瑰畾鐨勫紓甯革紝榪樻湁鍏朵粬璁稿寮傚父涔熷彲鑳藉嚭鐜般備緥濡傦紝濡傛灉鐢變簬鏌愮鍘熷洜錛宔xecuteQuery榪斿洖浜唍ull錛岃鎬庝箞鍔烇紵絳旀鏄瀹冧滑緇х畫鎶涘嚭錛屽嵆涓嶅繀鎹曡幏涔熶笉蹇呭鐞嗐傚疄闄呬笂錛屾垜浠笉鑳戒篃涓嶅簲璇ュ幓鎹曡幏鍙兘鍑虹幇鐨勬墍鏈夊紓甯革紝紼嬪簭鐨勫叾浠栧湴鏂硅繕鏈夋崟鑾峰紓甯哥殑鏈轟細鐩磋嚦鏈鍚庣敱JVM澶勭悊銆?

緇撹浜岋細鍦╟atch璇彞涓敖鍙兘鎸囧畾鍏蜂綋鐨勫紓甯哥被鍨嬶紝蹇呰鏃朵嬌鐢ㄥ涓猚atch銆備笉瑕佽瘯鍥懼鐞嗘墍鏈夊彲鑳藉嚭鐜扮殑寮傚父銆?

鍙嶄緥涔嬩笁錛氬崰鐢ㄨ祫婧愪笉閲婃斁

浠g爜錛?琛?14琛屻?

寮傚父鏀瑰彉浜嗙▼搴忔甯哥殑鎵ц嫻佺▼銆傝繖涓亾鐞嗚櫧鐒剁畝鍗曪紝鍗村父甯歌浜轟滑蹇借銆傚鏋滅▼搴忕敤鍒頒簡鏂囦歡銆丼ocket銆丣DBC榪炴帴涔嬬被鐨勮祫婧愶紝鍗充嬌閬囧埌浜嗗紓甯革紝涔熻姝g‘閲婃斁鍗犵敤鐨勮祫婧愩備負姝わ紝Java鎻愪緵浜嗕竴涓畝鍖栬繖綾繪搷浣滅殑鍏抽敭璇峟inally銆?

finally鏄牱濂戒笢瑗匡細涓嶇鏄惁鍑虹幇浜嗗紓甯革紝Finally淇濊瘉鍦╰ry/catch/finally鍧楃粨鏉熶箣鍓嶏紝鎵ц娓呯悊浠誨姟鐨勪唬鐮佹繪槸鏈夋満浼氭墽琛屻傞仐鎲劇殑鏄湁浜涗漢鍗翠笉涔犳儻浣跨敤finally銆?

褰撶劧錛岀紪鍐檉inally鍧楀簲褰撳鍔犲皬蹇冿紝鐗瑰埆鏄娉ㄦ剰鍦╢inally鍧椾箣鍐呮姏鍑虹殑寮傚父??榪欐槸鎵ц娓呯悊浠誨姟鐨勬渶鍚庢満浼氾紝灝介噺涓嶈鍐嶆湁闅句互澶勭悊鐨勯敊璇?

緇撹涓夛細淇濊瘉鎵鏈夎祫婧愰兘琚紜噴鏀俱傚厖鍒嗚繍鐢╢inally鍏抽敭璇嶃?

鍙嶄緥涔嬪洓錛氫笉璇存槑寮傚父鐨勮緇嗕俊鎭?

浠g爜錛?琛?18琛屻?

浠旂粏瑙傚療榪欐浠g爜錛氬鏋滃驚鐜唴閮ㄥ嚭鐜頒簡寮傚父錛屼細鍙戠敓浠涔堜簨鎯咃紵鎴戜滑鍙互寰楀埌瓚沖鐨勪俊鎭垽鏂驚鐜唴閮ㄥ嚭閿欑殑鍘熷洜鍚楋紵涓嶈兘銆傛垜浠彧鑳界煡閬撳綋鍓嶆鍦ㄥ鐞嗙殑綾誨彂鐢熶簡鏌愮閿欒錛屼絾鍗翠笉鑳借幏寰椾換浣曚俊鎭垽鏂鑷村綋鍓嶉敊璇殑鍘熷洜銆?

printStackTrace鐨勫爢鏍堣窡韙姛鑳芥樉紺哄嚭紼嬪簭榪愯鍒板綋鍓嶇被鐨勬墽琛屾祦紼嬶紝浣嗗彧鎻愪緵浜嗕竴浜涙渶鍩烘湰鐨勪俊鎭紝鏈兘璇存槑瀹為檯瀵艱嚧閿欒鐨勫師鍥狅紝鍚屾椂涔熶笉鏄撹В璇匯?

鍥犳錛屽湪鍑虹幇寮傚父鏃訛紝鏈濂借兘澶熸彁渚涗竴浜涙枃瀛椾俊鎭紝渚嬪褰撳墠姝e湪鎵ц鐨勭被銆佹柟娉曞拰鍏朵粬鐘舵佷俊鎭紝鍖呮嫭浠ヤ竴縐嶆洿閫傚悎闃呰鐨勬柟寮忔暣鐞嗗拰緇勭粐printStackTrace鎻愪緵鐨勪俊鎭?

緇撹鍥涳細鍦ㄥ紓甯稿鐞嗘ā鍧椾腑鎻愪緵閫傞噺鐨勯敊璇師鍥犱俊鎭紝緇勭粐閿欒淇℃伅浣垮叾鏄撲簬鐞嗚В鍜岄槄璇匯?

鍙嶄緥涔嬩簲錛氳繃浜庡簽澶х殑try鍧?

浠g爜錛?琛?14琛屻?

緇忓父鍙互鐪嬪埌鏈変漢鎶婂ぇ閲忕殑浠g爜鏀懼叆鍗曚釜try鍧楋紝瀹為檯涓婅繖涓嶆槸濂戒範鎯傝繖縐嶇幇璞′箣鎵浠ュ父瑙侊紝鍘熷洜灝卞湪浜庢湁浜涗漢鍥劇渷浜嬶紝涓嶆効鑺辨椂闂村垎鏋愪竴澶у潡浠g爜涓摢鍑犺浠g爜浼氭姏鍑哄紓甯搞佸紓甯哥殑鍏蜂綋綾誨瀷鏄粈涔堛傛妸澶ч噺鐨勮鍙ヨ鍏ュ崟涓法澶х殑try鍧楀氨璞℃槸鍑洪棬鏃呮父鏃舵妸鎵鏈夋棩甯哥敤鍝佸鍏ヤ竴涓ぇ綆卞瓙錛岃櫧鐒朵笢瑗挎槸甯︿笂浜嗭紝浣嗚鎵懼嚭鏉ュ彲涓嶅鏄撱?

涓浜涙柊鎵嬪父甯告妸澶ч噺鐨勪唬鐮佹斁鍏ュ崟涓猼ry鍧楋紝鐒跺悗鍐嶅湪catch璇彞涓0鏄嶦xception錛岃屼笉鏄垎紱誨悇涓彲鑳藉嚭鐜板紓甯哥殑孌佃惤騫跺垎鍒崟鑾峰叾寮傚父銆傝繖縐嶅仛娉曚負鍒嗘瀽紼嬪簭鎶涘嚭寮傚父鐨勫師鍥犲甫鏉ヤ簡鍥伴毦錛屽洜涓轟竴澶ф浠g爜涓湁澶鐨勫湴鏂瑰彲鑳芥姏鍑篍xception銆?

緇撹浜旓細灝介噺鍑忓皬try鍧楃殑浣撶Н銆?

鍙嶄緥涔嬪叚錛氳緭鍑烘暟鎹笉瀹屾暣

浠g爜錛?琛?11琛屻?

涓嶅畬鏁寸殑鏁版嵁鏄疛ava紼嬪簭鐨勯殣褰㈡潃鎵嬨備粩緇嗚瀵熻繖孌典唬鐮侊紝鑰冭檻涓涓嬪鏋滃驚鐜殑涓棿鎶涘嚭浜嗗紓甯革紝浼氬彂鐢熶粈涔堜簨鎯呫傚驚鐜殑鎵ц褰撶劧鏄琚墦鏂殑錛屽叾嬈★紝catch鍧椾細鎵ц??灝辮繖浜涳紝鍐嶄篃娌℃湁鍏朵粬鍔ㄤ綔浜嗐?

宸茬粡杈撳嚭鐨勬暟鎹庝箞鍔烇紵浣跨敤榪欎簺鏁版嵁鐨勪漢鎴栬澶囧皢鏀跺埌涓浠戒笉瀹屾暣鐨勶紙鍥犺屼篃鏄敊璇殑錛夋暟鎹紝鍗村緱涓嶅埌浠諱綍鏈夊叧榪欎喚鏁版嵁鏄惁瀹屾暣鐨勬彁紺恒傚浜庢湁浜涚郴緇熸潵璇達紝鏁版嵁涓嶅畬鏁村彲鑳芥瘮緋葷粺鍋滄榪愯甯︽潵鏇村ぇ鐨勬崯澶便?

杈冧負鐞嗘兂鐨勫緗姙娉曟槸鍚戣緭鍑鴻澶囧啓涓浜涗俊鎭紝澹版槑鏁版嵁鐨勪笉瀹屾暣鎬э紱鍙︿竴縐嶅彲鑳芥湁鏁堢殑鍔炴硶鏄紝鍏堢紦鍐茶杈撳嚭鐨勬暟鎹紝鍑嗗濂藉叏閮ㄦ暟鎹箣鍚庡啀涓嬈℃ц緭鍑恒?

緇撹鍏細鍏ㄩ潰鑰冭檻鍙兘鍑虹幇鐨勫紓甯鎬互鍙婅繖浜涘紓甯稿鎵ц嫻佺▼鐨勫獎鍝嶃?

鏀瑰啓鍚庣殑浠g爜

鏍規嵁涓婇潰鐨勮璁猴紝涓嬮潰緇欏嚭鏀瑰啓鍚庣殑浠g爜銆備篃璁告湁浜轟細璇村畠紼嶅井鏈夌偣?鍡︼紝浣嗘槸瀹冩湁浜嗘瘮杈冨畬澶囩殑寮傚父澶勭悊鏈哄埗銆?


OutputStreamWriter out = ...
銆銆java.sql.Connection conn = ...
銆銆try {
銆銆銆Statement stat = conn.createStatement();
銆銆銆ResultSet rs = stat.executeQuery("select uid, name from user");
銆銆銆while (rs.next()){
銆銆銆銆out.println("ID錛? + rs.getString("uid") + "錛屽鍚? "+ rs.getString("name"));
銆銆銆}
銆銆}
銆銆catch(SQLException sqlex)
銆銆{
銆銆銆out.println("璀﹀憡錛氭暟鎹笉瀹屾暣");
銆銆銆throw new ApplicationException("璇誨彇鏁版嵁鏃跺嚭鐜癝QL閿欒", sqlex);
銆銆}
銆銆catch(IOException ioex)
銆銆{
銆銆銆throw new ApplicationException("鍐欏叆鏁版嵁鏃跺嚭鐜癐O閿欒", ioex);
銆銆}
銆銆finally
銆銆{
銆銆銆if (conn != null) {
銆銆銆銆try {
銆銆銆銆銆conn.close();
銆銆銆銆}
銆銆銆銆catch(SQLException sqlex2)
銆銆銆銆{
銆銆銆銆銆System.err(this.getClass().getName() + ".mymethod - 涓嶈兘鍏抽棴鏁版嵁搴撹繛鎺?" + sqlex2.toString());
銆銆銆銆}
銆銆銆}
銆銆銆if (out != null){
銆銆銆銆try {
銆銆銆銆銆out.close();
銆銆銆銆}
銆銆銆銆catch(IOException ioex2)
銆銆銆銆{
銆銆銆銆銆System.err(this.getClass().getName() + ".mymethod - 涓嶈兘鍏抽棴杈撳嚭鏂囦歡" + ioex2.toString());
銆銆銆銆}
銆銆銆}
銆銆}




鏈枃鐨勭粨璁轟笉鏄斁涔嬪洓嫻風殕鍑嗙殑鏁欐潯錛屾湁鏃跺父璇嗗拰緇忛獙鎵嶆槸鏈濂界殑鑰佸笀銆傚鏋滀綘瀵硅嚜宸辯殑鍋氭硶娌℃湁鐧懼垎涔嬬櫨鐨勪俊蹇冿紝鍔″繀鍔犱笂璇︾粏銆佸叏闈㈢殑娉ㄩ噴銆?

涓鏂歸潰錛屼笉瑕佺瑧璇濊繖浜涢敊璇紝涓嶅Θ闂棶浣犺嚜宸辨槸鍚︾湡鍦板交搴曟憜鑴變簡榪欎簺鍧忎範鎯傚嵆浣挎渶鏈夌粡楠岀殑紼嬪簭鍛樺伓灝斾篃浼氳鍏ユ閫旓紝鍘熷洜寰堢畝鍗曪紝鍥犱負瀹冧滑紜‘瀹炲疄甯︽潵浜嗏滄柟渚庫濄傛墍鏈夎繖浜涘弽渚嬮兘鍙互鐪嬩綔Java緙栫▼涓栫晫鐨勬伓欖旓紝瀹冧滑緹庝附鍔ㄤ漢錛屾棤瀛斾笉鍏ワ紝鏃跺埢璇辨儜鐫浣犮備篃璁告湁浜轟細璁や負榪欎簺閮藉睘浜庨浮鐨挏姣涚殑灝忎簨錛屼笉瓚蟲寕榻匡紝浣嗚璁頒綇錛氬嬁浠ユ伓灝忚屼負涔嬶紝鍕夸互鍠勫皬鑰屼笉涓恒?

]]>
JSP褰╄壊楠岃瘉鐮?/title><link>http://www.tkk7.com/luckyrobbie/archive/2006/03/27/37552.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Mon, 27 Mar 2006 02:13:00 GMT</pubDate><guid>http://www.tkk7.com/luckyrobbie/archive/2006/03/27/37552.html</guid><wfw:comment>http://www.tkk7.com/luckyrobbie/comments/37552.html</wfw:comment><comments>http://www.tkk7.com/luckyrobbie/archive/2006/03/27/37552.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/luckyrobbie/comments/commentRss/37552.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/luckyrobbie/services/trackbacks/37552.html</trackback:ping><description><![CDATA[ <div> <div> <h2> <font face="Arial" size="3">JSP褰╄壊楠岃瘉鐮?/font> </h2> <a > <u> <font face="Arial" color="#0000ff">xiaohanne</font> </u> </a> <font face="Arial"> 鍙戣〃浜?004-06-01 浣滆?xiaohanne 璇勪環:13/6 璇勮鏁?5 鐐瑰嚮鏁?5229 [</font> <a > <u> <font face="Arial" color="#0000ff">鏀惰棌</font> </u> </a> <font face="Arial">] </font> </div> <div> <div> <font face="Arial"> </font> </div> <div> <font face="Arial">鎽樿錛?br /><br /><br /><br />鏈枃Matrix姘鎬箙闀滃儚錛?/font> <a > <u> <font face="Arial" color="#0000ff">http://www.matrix.org.cn/resource/article/0/910.html</font> </u> </a> <font face="Arial"> <br />璇存槑錛氭湰鏂囧彲鑳界敱Matrix鍘熷垱錛屼篃鍙兘鐢盡atrix鐨勪細鍛樻暣鐞嗭紝鎴栬呯敱<br />Matrix鐨凜rawler鍦ㄥ叏鐞冪煡鍚岼ava鎴栬呭叾浠栨妧鏈浉鍏崇珯鐐規姄鍙栧茍姘鎬箙<br />淇濈暀闀滃儚錛孧atrix浼氫繚鐣欐墍鏈夊師鏉ョ殑鍑哄URL錛屽茍鍦ㄦ樉钁楀湴鏂逛綔鍑鴻鏄庯紝<br />濡傛灉浣犲彂瑙夊嚭澶刄RL鏈夎錛岃鑱旂郴Matrix鏀規.<br /></font> </div> </div> <div> <font face="Arial">鐢熸垚鏈?涓殢鏈烘暟瀛楀拰鏉備貢鑳屾櫙鐨勫浘鐗囷紝鏁板瓧鍜岃儗鏅鑹蹭細鏀瑰彉錛屾湇鍔″櫒绔埛鏂幫紙鐢╤istory.go(-1)涔熶細鍙橈級<br />鍘熷瀷鍙傝傾LIBABA聽聽</font> <a > <u> <font face="Arial" color="#800080">http://china.alibaba.com/member/showimage</font> </u> </a> <br /> <br /> <font face="Arial">------------浜х敓楠岃瘉鐮佸浘鐗囩殑鏂囦歡-----image.jsp-------------------------------------------<br /><br /><%@ page contentType="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*" %><br /><%!<br />Color getRandColor(int fc,int bc){//緇欏畾鑼冨洿鑾峰緱闅忔満棰滆壊<br />聽聽聽聽聽聽聽聽Random random = new Random();<br />聽聽聽聽聽聽聽聽if(fc>255) fc=255;<br />聽聽聽聽聽聽聽聽if(bc>255) bc=255;<br />聽聽聽聽聽聽聽聽int r=fc+random.nextInt(bc-fc);<br />聽聽聽聽聽聽聽聽int g=fc+random.nextInt(bc-fc);<br />聽聽聽聽聽聽聽聽int b=fc+random.nextInt(bc-fc);<br />聽聽聽聽聽聽聽聽return new Color(r,g,b);<br />聽聽聽聽聽聽聽聽}<br />%><br /><%<br />//璁劇疆欏甸潰涓嶇紦瀛?br />response.setHeader("Pragma","No-cache");<br />response.setHeader("Cache-Control","no-cache");<br />response.setDateHeader("Expires", 0);<br /><br />// 鍦ㄥ唴瀛樹腑鍒涘緩鍥捐薄<br />int width=60, height=20;<br />BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);<br /><br />// 鑾峰彇鍥懼艦涓婁笅鏂?br />Graphics g = image.getGraphics();<br /><br />//鐢熸垚闅忔満綾?br />Random random = new Random();<br /><br />// 璁懼畾鑳屾櫙鑹?br />g.setColor(getRandColor(200,250));<br />g.fillRect(0, 0, width, height);<br /><br />//璁懼畾瀛椾綋<br />g.setFont(new Font("Times New Roman",Font.PLAIN,18));<br /><br />//鐢昏竟妗?br />//g.setColor(new Color());<br />//g.drawRect(0,0,width-1,height-1);<br /><br /><br />// 闅忔満浜х敓155鏉″共鎵扮嚎錛屼嬌鍥捐薄涓殑璁よ瘉鐮佷笉鏄撹鍏跺畠紼嬪簭鎺㈡祴鍒?br />g.setColor(getRandColor(160,200));<br />for (int i=0;i<155;i++)<br />{<br />聽聽聽聽聽聽聽聽int x = random.nextInt(width);<br />聽聽聽聽聽聽聽聽int y = random.nextInt(height);<br />聽聽聽聽聽聽聽聽int xl = random.nextInt(12);<br />聽聽聽聽聽聽聽聽int yl = random.nextInt(12);<br />聽聽聽聽聽聽聽聽g.drawLine(x,y,x+xl,y+yl);<br />}<br /><br />// 鍙栭殢鏈轟駭鐢熺殑璁よ瘉鐮?4浣嶆暟瀛?<br />String sRand="";<br />for (int i=0;i<4;i++){<br />聽聽聽聽String rand=String.valueOf(random.nextInt(10));<br />聽聽聽聽sRand+=rand;<br />聽聽聽聽// 灝嗚璇佺爜鏄劇ず鍒板浘璞′腑<br />聽聽聽聽g.setColor(new Color(20+random.nextInt(110),20+random.nextInt(110),20+random.nextInt(110)));//璋冪敤鍑芥暟鍑烘潵鐨勯鑹茬浉鍚岋紝鍙兘鏄洜涓虹瀛愬お鎺ヨ繎錛屾墍浠ュ彧鑳界洿鎺ョ敓鎴?br />聽聽聽聽g.drawString(rand,13*i+6,16);<br />}<br /><br />// 灝嗚璇佺爜瀛樺叆SESSION<br />session.setAttribute("rand",sRand);<br /><br /><br />// 鍥捐薄鐢熸晥<br />g.dispose();<br /><br />// 杈撳嚭鍥捐薄鍒伴〉闈?br />ImageIO.write(image, "JPEG", response.getOutputStream());<br /><br /><br />%> <br /><br />---------------浣跨敤楠岃瘉鐮佸浘鐗囩殑鏂囦歡---------a.jsp------------------------------------<br /><br /><%@ page contentType="text/html;charset=gb2312" %><br /><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br /><html><br /><head><br /><title>璁よ瘉鐮佽緭鍏ラ〉闈?lt;/title><br /><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br /><META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <br /><META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <br /><META HTTP-EQUIV="Expires" CONTENT="0"> <br /></head><br /><body><br /><form method=post action="check.jsp"><br /><table><br /><tr><br /><td align=left>緋葷粺浜х敓鐨勮璇佺爜錛?lt;/td><br /><td><img border=0 src="image.jsp"></td><br /></tr><br /><tr><br /><td align=left>杈撳叆涓婇潰鐨勮璇佺爜錛?lt;/td><br /><td><input type=text name=rand maxlength=4 value=""></td><br /></tr><br /><tr><br /><td colspan=2 align=center><input type=submit value="鎻愪氦媯嫻?></td><br /></tr><br /></form><br /></body><br /></html><br /><br />-----------------楠岃瘉鐨勯〉闈?---------check.jsp<br /><br /><%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><br /><html><br /><head><br /><title>璁よ瘉鐮侀獙璇侀〉闈?lt;/title><br /><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br /><META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <br /><META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <br /><META HTTP-EQUIV="Expires" CONTENT="0"> <br /></head><br /><br /><body><br /><% <br />String rand = (String)session.getAttribute("rand");<br />String input = request.getParameter("rand");<br />%><br />緋葷粺浜х敓鐨勮璇佺爜涓猴細 <%= rand %><br><br />鎮ㄨ緭鍏ョ殑璁よ瘉鐮佷負錛?<%= input %><br><br /><br><br /><%<br />聽聽if (rand.equals(input)) {<br />%><br /><font color=green>杈撳叆鐩稿悓錛岃璇佹垚鍔燂紒</font><br /><%<br />聽聽} else {<br />%><br /><font color=red>杈撳叆涓嶅悓錛岃璇佸け璐ワ紒</font><br /><%<br />聽聽}<br />%><br /></body><br /></html><br /></font> </div> </div> <img src ="http://www.tkk7.com/luckyrobbie/aggbug/37552.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-03-27 10:13 <a href="http://www.tkk7.com/luckyrobbie/archive/2006/03/27/37552.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎴戜互鍓嶇殑涓涓猘nt, 鐢ㄤ簬浠ュ悗copyhttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37550.htmlluckyrobbieluckyrobbieMon, 27 Mar 2006 02:07:00 GMThttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37550.htmlhttp://www.tkk7.com/luckyrobbie/comments/37550.htmlhttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37550.html#Feedback0http://www.tkk7.com/luckyrobbie/comments/commentRss/37550.htmlhttp://www.tkk7.com/luckyrobbie/services/trackbacks/37550.html 鑷繁鐨刡uild.xml聽
<?xml version="1.0" encoding="gb2312"?>
<project name="app" default="build" basedir=".">
聽<property name="app.name" value="hello-ant"/>
聽聽聽 聽<property name="app.jar" value="${app.name}.jar"/>
聽聽聽 聽<property name="app.copyright" value=" Copyright (c) 2005 The Robbie's Software Foundation.聽 All rights reserved."/>

聽<property name="src.dir" location="src"/>
聽<property name="build.dir" location="build"/>
聽<property name="build.docs" value="${build.dir}/docs"/>
聽<property name="build.docs.api" value="${build.docs}/api"/>
聽<property name="dist.dir" location="dist"/>
聽<property name="lib.dir" location="lib"/>
聽<property environment="env"/> <!--鍙栫郴緇熺幆澧冨彉閲?->

聽<path id="myclasspath">
聽聽<fileset dir="${lib.dir}">
聽聽聽<include name="**/*.jar"/>
聽聽</fileset>
聽聽<fileset dir="${env.STRUTS_HOME}">
聽聽聽<include name="lib/*.jar"/>
聽聽</fileset>
<!--
pathelement鍙兘娣誨姞鍗曚釜鐨刯ar鏂囦歡, 娌℃湁fileset鏂逛究
聽聽<pathelement path="${env.STRUTS_HOME}/lib/struts.jar"/>
-->聽聽
聽</path>

聽<target name="init" depends="clean">
聽聽<echo message="鍒濆鍖?.."/>
聽聽<mkdir dir="${build.dir}"/>
聽</target>

聽<target name="build" depends="init">
聽聽<echo message="緙栬瘧涓?.."/>
聽聽<javac srcdir="${src.dir}" destdir="${build.dir}" verbose="true">
聽聽聽<classpath refid="myclasspath"/>
聽聽<compilerarg value="-Xlint:all"/> <!--緗戜笂鎵句簡鍗婂ぉ鎵嶆壘鍒扮殑, 鐢ㄤ簬娣誨姞javac鐨勭紪璇戝弬鏁?->
聽聽</javac>
聽</target>

聽<target name="clean">
聽聽<echo message="娓呯悊涓?.."/>
聽聽<delete dir="${build.dir}"/>
聽聽<delete dir="${dist.dir}"/>
聽</target>

聽<target name="dist" depends="build">
聽聽<echo message="鍒朵綔jar..."/>
聽聽<tstamp/>
聽聽<mkdir dir="${dist.dir}"/>
聽聽<jar destfile="${dist.dir}/app-${DSTAMP}${TSTAMP}.jar" basedir="${build.dir}"/>聽聽
聽</target>

聽<target name="javadocs" depends="dist">
聽聽<echo message="鍒朵綔api鎵嬪唽..."/>
聽聽<mkdir dir="${build.docs.api}"/>
聽聽聽聽聽聽聽 聽<javadoc packagenames="tax.*"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽聽 sourcepath="${src.dir}"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 defaultexcludes="yes"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽 destdir="${build.docs.api}"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽 author="true"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽 version="true"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽 use="true"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽 windowtitle="Docs API">
聽聽聽聽聽聽聽聽聽聽聽聽 聽聽<doctitle><![CDATA[<h1>tax struts ant API Docs</h1>]]></doctitle>
聽聽聽聽聽聽聽聽聽聽聽聽 聽聽<bottom><![CDATA[<i>${app.copyright}</i>]]></bottom>
聽聽聽聽聽聽聽 </javadoc>
聽聽聽 聽</target>
</project>


聽鍒漢鐨刡uild.xml
<?xml version="1.0"聽 encoding="GB2312" ?>
<!--
聽聽聽 =======================================================================
聽聽聽聽聽 hello-ant 欏圭洰 ,瀛︿範ant宸ュ叿鐨勭2涓猙uild file.
聽聽聽聽聽 鍙傜収ant鐨刯akarta-ant-1.6alpha鐨刡uild.xml
聽聽聽聽聽 Copyright (c) 2002 The Neusoft Software Foundation.聽 All rights
聽聽聽聽聽 reserved.
聽聽聽 =======================================================================
-->
<project default="dist" basedir=".">
<!--
聽聽聽 ===================================================================
聽聽聽聽聽 瀹氫箟灞炴э紙property tasks錛?br />聽聽聽聽聽 鏈濂芥妸鐢ㄥ埌鐨勮礬寰勫憖錛屽悕縐板憖閮藉湪榪欓噷瀹氫箟鎴愬叏灞鍙橀噺
聽聽聽聽聽 渚嬶細瀹氫箟
聽聽聽聽聽聽聽聽聽 <property name="a" value="hello"/>
聽聽聽聽聽 浠ュ悗灝卞彲浠ヨ繖鏍風敤瀹冿細
聽聽聽聽聽聽聽聽聽 <property name="b" value="${a}/b"/>
聽聽聽聽聽 鐜板湪:b=="hello/b"
聽聽聽 ===================================================================
-->
聽聽聽 <!--涓昏鐨勭郴緇熺幆澧冨睘鎬?->
聽聽聽 <property environment="env"/><!--鍙杦indow,unix...鐨勭幆澧冨彉閲?->
聽聽聽 <property name="java.home" value="${env.JAVA_HOME}"/>
聽聽聽 <property name="ant.home"聽 value="${env.ANT_HOME}"/>
聽聽聽 <!--涓昏鐨刟pp鐜灞炴?->
聽聽聽 <property name="app.name"聽聽聽聽聽 value="hello-ant"/>
聽聽聽 <property name="app.jar"聽聽聽聽聽聽 value="${app.name}.jar"/>
聽聽聽 <property name="app.copyright" value=" Copyright (c) 2002 The Neusoft Software Foundation.聽 All rights reserved."/>

聽聽聽 <!--app涓璼rc鐨勫睘鎬?->
聽聽聽 <property name="src.dir"聽聽聽 value="src" />
聽聽聽 <property name="src.main"聽聽 value="${src.dir}/main"/>
聽聽聽 <property name="src.script" value="${src.dir}/script"/>
聽聽聽 <!--app鐢ㄥ埌鐨刲ib-->
聽聽聽 <property name="lib.dir" value="lib"/>
聽聽聽 <!--app鐨刡uild鐩綍涓?->
聽聽聽 <property name="build.dir"聽聽聽聽聽 value="build" />
聽聽聽 <property name="build.classes"聽 value="${build.dir}/classes"/>
聽聽聽 <property name="build.docs"聽聽聽聽 value="${build.dir}/docs"/>
聽聽聽 <property name="build.docs.api" value="${build.docs}/api"/>
聽聽聽 <property name="build.lib"聽聽聽聽聽 value="${build.dir}/lib"/>
聽聽聽 <!--app鐨刣ist (distribution) 鐩綍涓?->
聽聽聽 <property name="dist.dir"聽聽聽聽聽 value="dist"/>
聽聽聽 <property name="dist.bin"聽聽聽聽聽 value="${dist.dir}/bin"/>
聽聽聽 <property name="dist.docs"聽聽聽聽 value="${dist.dir}/docs"/>
聽聽聽 <property name="dist.lib"聽聽聽聽聽 value="${dist.dir}/lib"/>
聽聽聽 <!--app鐨刣ocs鐩綍涓?->
聽聽聽 <property name="docs.dir"聽聽聽聽聽 value="docs"/>
聽聽聽 <!--
聽聽聽 瀹氫箟涓緇勮礬寰勪互鍚庡彲浠ラ氳繃id閲嶇敤榪欑粍璺緞 錛屼緥錛?br />聽聽聽 <javac srcdir="src/main" destdir="build/classes">
聽聽聽聽聽聽聽聽聽聽聽 <classpath refid="classpath"/>
聽聽聽 </javac>
聽聽聽 -->
聽聽聽 <path id="classpath">
聽聽聽聽聽聽聽 <!--鏈」鐩彧鏈変竴涓猨ava錛岀敤涓嶄笂classpath錛岃繖閲屽彧鏄仛涓緥瀛?->
聽聽聽聽聽聽聽 <pathelement location="${build.classes}"/>
聽聽聽聽聽聽聽 <pathelement path="${java.home}/lib/tools.jar"/>
聽聽聽 </path>
<!--
聽聽聽 ===================================================================
聽聽聽聽聽 init 鍑嗗鐩綍(File Tasks)
聽聽聽聽聽 涓昏鐨勭洰褰曠粨鏋勯氬父鏄笉浼氬彉鐨勶紝涓璧風敓鎴愪粬浠?br />聽聽聽 ===================================================================
-->
聽聽聽 <target name="init">
聽聽聽聽聽聽聽 <!--娓呴櫎浠ュ墠鐩綍-->
聽聽聽聽聽聽聽 <delete dir="${build.dir}" failonerror="false" />
聽聽聽聽聽聽聽 <delete dir="${dist.dir}"聽 failonerror="false"/>
聽聽聽聽聽聽聽 <!--鍑嗗鐩綍-->
聽聽聽聽聽聽聽 <mkdir dir="${build.dir}"/>
聽聽聽聽聽聽聽 <mkdir dir="${build.classes}"/>
聽聽聽聽聽聽聽 <mkdir dir="${build.docs}"/>
聽聽聽聽聽聽聽 <mkdir dir="${build.docs.api}"/>
聽聽聽聽聽聽聽 <mkdir dir="${build.lib}"/>
聽聽聽聽聽聽聽 <mkdir dir="${dist.dir}"/>
聽聽聽聽聽聽聽 <mkdir dir="${dist.bin}"/>
聽聽聽聽聽聽聽 <mkdir dir="${dist.lib}"/>
聽聽聽 </target>
<!--
聽聽聽 ===================================================================
聽聽聽聽聽 Build the code (Compile Tasks,File Tasks)
聽聽聽 ===================================================================
-->
聽聽聽 <target name="build" depends="init">
聽聽聽聽聽聽聽 <!--緙栬瘧-->
聽聽聽聽聽聽聽 <javac srcdir="${src.main}" destdir="${build.classes}">
聽聽聽聽聽聽聽聽聽聽聽 <classpath refid="classpath"/>
聽聽聽聽聽聽聽 </javac>
聽聽聽 </target>
<!--
聽聽聽 ===================================================================
聽聽聽聽聽 鎵撳寘鏂囨。(Archive Tasks)
聽聽聽聽聽 Create the project jars: xxx1.jar and xxx2.jar
聽聽聽 ===================================================================
-->
聽聽 <target name="jars" depends="build">
聽聽聽聽聽聽聽 <jar basedir="${build.classes}" jarfile="${build.lib}/${app.jar}"/>
聽聽聽 </target>
<!--
聽聽聽聽 ===================================================================
聽聽聽聽聽聽 Creates the API documentation
聽聽聽聽 ===================================================================
-->
聽聽聽 <target name="javadocs"
聽聽聽聽聽聽聽聽聽聽聽 depends="jars"
聽聽聽聽聽聽聽聽聽聽聽 description="--> creates the API documentation">
聽聽聽聽聽聽聽 <!--copy docs 鎵嬪唽... -->
聽聽聽聽聽聽聽 <copy todir="${build.docs}">
聽聽聽聽聽聽聽聽聽聽聽 <fileset dir="${docs.dir}"/>
聽聽聽聽聽聽聽 </copy>
聽聽聽聽聽聽聽 <javadoc packagenames="hello.ant.*"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 sourcepath="${src.main}"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 defaultexcludes="yes"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 destdir="${build.docs.api}"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 author="true"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 version="true"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 use="true"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 windowtitle="Docs API">
聽聽聽聽聽聽聽聽聽聽聽聽 <doctitle><![CDATA[<h1>hello ant Docs API</h1>]]></doctitle>
聽聽聽聽聽聽聽聽聽聽聽聽 <bottom><![CDATA[<i>${app.copyright}</i>]]></bottom>
聽聽聽聽聽聽聽聽聽聽聽聽 <tag name="todo" scope="all" description="To do:" />
聽聽聽聽聽聽聽聽 </javadoc>
聽聽聽 </target>
<!--
聽聽聽聽 ===================================================================
聽聽聽聽聽聽 Create the distribution that can run (Archive Tasks)
聽聽聽聽聽聽 涓昏鏄粠鍚勭洰褰曚腑鎶婅copy鐨刢opy涓?br />聽聽聽聽 ===================================================================
-->
聽聽 <target name="dist" depends="javadocs">
聽聽聽聽聽聽聽 <!--copy bin 鎵ц鏂囦歡 -->
聽聽聽聽聽聽聽 <copy todir="${dist.bin}">
聽聽聽聽聽聽聽聽聽聽聽 <fileset dir="${src.script}/"/>
聽聽聽聽聽聽聽 </copy>
聽聽聽聽聽聽聽 <copy todir="${dist.docs}">
聽聽聽聽聽聽聽聽聽聽聽 <fileset dir="${build.docs}/"/>
聽聽聽聽聽聽聽 </copy>
聽聽聽聽聽聽聽 <!-- copy lib 鏂囦歡 -->
聽聽聽聽聽聽聽 <copy todir="${dist.lib}">
聽聽聽聽聽聽聽聽聽聽聽 <fileset dir="${build.lib}/"/>
聽聽聽聽聽聽聽 </copy>
聽聽聽 </target>
<!--
聽聽聽聽 ===================================================================
聽聽聽聽聽 Cleans everything(File Tasks)
聽聽聽聽聽 渚嬪鍙互鍒犻櫎build涓殑鏂囦歡錛岀暀緇欎綘鍙戞尌鍚?br />聽聽聽聽 ===================================================================
-->
</project>


]]>
struts涓紲html:messages錛炴爣絳劇殑浣跨敤http://www.tkk7.com/luckyrobbie/archive/2006/03/27/37548.htmlluckyrobbieluckyrobbieMon, 27 Mar 2006 02:02:00 GMThttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37548.htmlhttp://www.tkk7.com/luckyrobbie/comments/37548.htmlhttp://www.tkk7.com/luckyrobbie/archive/2006/03/27/37548.html#Feedback4http://www.tkk7.com/luckyrobbie/comments/commentRss/37548.htmlhttp://www.tkk7.com/luckyrobbie/services/trackbacks/37548.html Action涓殑浠g爜:
ActionMessages actionMessages=new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("......"));
saveMessages(request, actionMessages);
瀵瑰簲鐨刯sp涓?
<html:messages id="message" message="true">
聽聽聽聽聽 <bean:write name="message"/>
</html:messages>
  • name : 鎸囧畾ActionMessages瀛樻斁鍦╮equest鎴栬卻ession鍐呯殑灞炴ey.
  • message: 鎸囧畾娑堟伅鐨勬潵婧? 濡傛灉涓簍rue, 瀵瑰簲浜巏ey=Globals.MESSAGE_KEY鐨凙ctionMessages瀵硅薄, 姝ゆ椂name灞炴ф棤鏁堬紱濡傛灉涓篺alse, 鍒欐牴鎹畁ame灞炴ф绱ctionMessages瀵硅薄, 濡傛灉娌℃湁璁劇疆name, 榛樿涓篏lobals.ERROR_KEY. message灞炴х殑榛樿鍊間負false.


]]>
主站蜘蛛池模板: 亚洲精品国产成人99久久| 国产极品美女高潮抽搐免费网站| 久久精品国产亚洲精品| 日韩亚洲人成在线综合| 国产在线a不卡免费视频| 亚洲国产欧美日韩精品一区二区三区 | 国产精品免费看久久久| 4338×亚洲全国最大色成网站| 美女被吸屁股免费网站| 亚洲精品无码日韩国产不卡?V| 麻豆安全免费网址入口| 国产亚洲精品资在线| 最近中文字幕大全免费版在线 | 久久久久久A亚洲欧洲AV冫| 一级女人18片毛片免费视频| 国产亚洲精品自在线观看| 免费女人高潮流视频在线观看| 亚洲综合日韩中文字幕v在线| 久草视频在线免费| 亚洲欧美国产欧美色欲| 亚洲国产精品自产在线播放| 青青操在线免费观看| 亚洲高清日韩精品第一区| 好爽…又高潮了免费毛片| 免费精品久久久久久中文字幕 | 国产亚洲精品久久久久秋霞| 久久国产乱子伦精品免费一| 亚洲综合伊人制服丝袜美腿| 国产免费观看黄AV片| 中文字幕在线成人免费看| 亚洲精品在线网站| 国产成人高清精品免费软件| 国产精品午夜免费观看网站| 91亚洲一区二区在线观看不卡| 免费涩涩在线视频网| 三级毛片在线免费观看| 亚洲an日韩专区在线| 亚洲综合最新无码专区| 无码中文在线二区免费| aaa毛片免费观看| 亚洲人成人网毛片在线播放|