锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲Av无码精品色午夜,亚洲国产精品久久久久网站,亚洲日韩乱码久久久久久http://m.tkk7.com/improviser/category/26126.html鎬濈淮鏄竴縐嶈壓鏈紝鑹烘湳闇瑕佺伒鎰?/description>zh-cnMon, 05 Nov 2007 04:13:20 GMTMon, 05 Nov 2007 04:13:20 GMT60鍋墮亣Spring MVChttp://m.tkk7.com/improviser/archive/2007/11/04/158025.htmlimproviserimproviserSun, 04 Nov 2007 02:44:00 GMThttp://m.tkk7.com/improviser/archive/2007/11/04/158025.htmlhttp://m.tkk7.com/improviser/comments/158025.htmlhttp://m.tkk7.com/improviser/archive/2007/11/04/158025.html#Feedback5http://m.tkk7.com/improviser/comments/commentRss/158025.htmlhttp://m.tkk7.com/improviser/services/trackbacks/158025.html聽聽聽 涓漢璁や負(fù)Spring鍏舵牳蹇冩槸鍏禝OC鍜孉OP鏂歸潰錛屽鍏禨pirngMVC妗嗘灦騫朵笉鍏蟲敞錛屾垜鐪嬪ソ鐨勬槸JSF錛岀畝鍗曟槗鎳傘備絾鏈榪戠敱浜庡伐浣滀笂闇瑕侊紝鎵浠ユ湁闇瑕佸SpringMVC鍋氫釜浜嗚В瀛︿範(fàn)錛屽洜姝わ紝鏈瀵筍pirngMVC鐨勭浉閬囩函灞炲伓閬?...
聽聽聽 SpingMVC鐨勬灦鏋勫叾瀹炰篃寰堢畝鍗曪紝瀹冮氳繃涓涓叡閫氱殑鍏ラ棬DispatcherServlet鏉ユ帴鏀舵墍鏈夌殑request錛屾帴涓嬫潵鏍規(guī)嵁request瑕佹眰鐨勯〉闈㈤氳繃handler杞佺粰C(jī)ontroller澶勭悊錛屽鐞嗙粨鏋滆繑鍥濾iew緇欑敤鎴鳳紝鍥犳瀵筍pringMVC鏉ヨ錛屽叾鏍稿績涓篋ispatcherServlet銆?br />聽聽聽 DispatcherServlet浣滀負(fù)涓鎵囬棬錛屾垜浠浣跨敤榪欎釜闂紝棣栧厛寰楀畨瑁呬笂榪欎釜闂紝瀹夎鍦ㄥ摢鍛紵娌¢敊錛屽氨瀹夎鍦╳eb.xml榪欎釜澶у眿瀛愶紝璞″叾浠杝ervlet涓鏍鳳紝鎻忚堪servlet鐨勫悕瀛楀拰綾伙紝鍐嶇粰浠栦竴涓猰apping鎻忚堪瀵瑰簲鏄犲皠鐨勭綉欏點(diǎn)傚湪涓嬩緥涓紝鎴戜滑緇橠ispatcherServlet鐨勮搗鍚嶄負(fù)SpringMVCDemo錛?/font>騫惰container鐭ラ亾鎵鏈?do緇撳熬鐨剅equest閮戒笩緇檇ispatcher銆?/span>
聽聽聽聽 < servlet >
聽聽聽聽聽聽聽聽
< servlet-name > SpringMVCDemo </ servlet-name >
聽聽聽聽聽聽聽聽
< servlet-class >
聽聽聽聽聽聽聽聽聽聽聽聽org.springframework.web.servlet.DispatcherServlet
聽聽聽聽聽聽聽聽
</ servlet-class >
聽聽聽聽聽聽聽聽
< load-on-startup > 1 </ load-on-startup >
聽聽聽聽
</ servlet >

聽聽聽聽
< servlet-mapping >
聽聽聽聽聽聽聽聽
< servlet-name > SpringMVCDemo </ servlet-name >
聽聽聽聽聽聽聽聽
< url-pattern > *.do </ url-pattern >
聽聽聽聽
</ servlet-mapping >
聽聽聽 闂ㄥ畨瑁呭ソ浜嗕箣鍚庯紝鎴戜滑闇瑕佸畾涔夐棬鑳芥墦寮鐨勮寖鍥達(dá)紝鍦ㄥ摢瀹氫箟鍛紵灝卞湪闂ㄧ殑涓婇潰璐翠笂涓寮犫滃叆闂ㄦ寚瀵尖濓紝浠嬬粛浠庡摢鏂歸潰(hello.do)榪涢棬闇瑕佷嬌鐢ㄤ綍縐嶄氦閫氭柟寮?springmvcController)榪涘幓錛屽茍瀹氫箟璇ヤ氦閫氭柟寮忋?/font>
聽聽聽聽 < bean聽 id ="urlMapping"
聽聽聽聽聽聽聽聽class
="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping" >
聽聽聽聽聽聽聽聽
< property聽 name ="mappings" >
聽聽聽聽聽聽聽聽聽聽聽聽
< props >
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
< prop聽 key ="/hello.do" > springmvcController </ prop >
聽聽聽聽聽聽聽聽聽聽聽聽
</ props >
聽聽聽聽聽聽聽聽
</ property >
聽聽聽聽
</ bean >

聽聽聽聽
<!-- 聽SpringmvcController聽 -->
聽聽聽聽
< bean聽 id ="springmvcController"
聽聽聽聽聽聽聽聽class
="org.improviser.webapp.controller.SpringmvcController" >
聽聽聽聽
</ bean >
聽聽聽 鎺ヤ笅鏉ヨ娓叉煋涓涓嬮〉闈簡錛屼笅闈負(fù)娓叉煋鎵鏈変互
WEB-INF/pages/ 寮澶?/font>錛?font color="#0000ff">騫朵互.jsp緇撳熬鐨勯〉闈€?/font>
聽聽聽聽 <!-- 聽ViewSolver聽 -->
聽聽聽聽
< bean聽 id ="viewResolver"
聽聽聽聽聽聽聽聽class
="org.springframework.web.servlet.view.InternalResourceViewResolver" >
聽聽聽聽聽聽聽聽
< property聽 name ="viewClass" >
聽聽聽聽聽聽聽聽聽聽聽聽
< value > org.springframework.web.servlet.view.JstlView </ value >
聽聽聽聽聽聽聽聽
</ property >
聽聽聽聽聽聽聽聽
< property聽 name ="prefix" >
聽聽聽聽聽聽聽聽聽聽聽聽
< value > /WEB-INF/pages/ </ value >
聽聽聽聽聽聽聽聽
</ property >
聽聽聽聽聽聽聽聽
< property聽 name ="suffix" >
聽聽聽聽聽聽聽聽聽聽聽聽
< value > .jsp </ value >
聽聽聽聽聽聽聽聽
</ property >
聽聽聽聽
</ bean >
聽聽聽涓婇潰鎻愬埌鐨凷pringmvcController錛?/font>鐜板湪璇ヤ綔涓畾涔変簡錛岃綾婚渶瑕佸疄鐜癈ontroller鎺ュ彛銆?/font>
publicclass聽SpringmvcController聽implements聽Controller聽{
聽聽聽聽
/**聽Logger聽for聽this聽class聽and聽subclasses聽*/
聽聽聽聽
protectedfinal聽Log聽logger聽=聽LogFactory.getLog(getClass());

聽聽聽聽
public聽ModelAndView聽handleRequest(HttpServletRequest聽request,
聽聽聽聽聽聽聽聽聽聽聽聽HttpServletResponse聽response)聽
throws聽ServletException,聽IOException聽{

聽聽聽聽聽聽聽聽Map聽model聽
=new聽HashMap();

聽聽聽聽聽聽聽聽String str
="鍗沖叴璇椾漢";
聽聽聽聽聽聽聽聽logger.info(
"returning聽hello聽view聽with聽"+聽currTime);
聽聽聽聽聽聽聽聽model.put(
"coldice", str);

聽聽聽聽聽聽聽聽
returnnew聽ModelAndView("hello",聽"message",聽model);
聽聽聽聽}
聽聽聽緙栧啓jsp嫻嬭瘯欏甸潰銆?/font>
<html>
聽聽聽聽
<head>
聽聽聽聽聽聽聽聽
<title>Spring聽Application</title>
聽聽聽聽
</head>
聽聽聽聽
<body>
聽聽聽聽聽聽聽聽
<h1>
聽聽聽聽聽聽聽聽聽聽聽聽
<br聽/>
聽聽聽聽聽聽聽聽聽聽聽聽Hello
聽聽聽 聽聽聽 聽聽聽 <c:out聽value="${message.coldice}"/></br>
聽聽聽 聽聽聽 聽聽聽 Spring聽MVC 嫻嬭瘯鎴愬姛錛?br />聽聽聽聽聽聽聽聽</h1>
聽聽聽聽
</body>
</html>
聽聽鐜板湪瀵逛互涓婂唴瀹逛綔涓葷粨錛屾濡備笂闈㈡墍鍙欒堪錛孲pringMVC妗嗘灦鐨勫鐞嗚繃紼嬫満鍒跺涓嬪浘鎵紺猴紝鎺ユ敹璇鋒眰欏甸潰錛岄氳繃DispatcherServlet鏄犲皠鍒扮浉搴旇鍒欏鐞嗭紝騫舵壘鍒扮浉搴旂殑鎺у埗鍣紝緇撴灉鎺у埗鍣ㄥ鐞嗗悗榪斿洖鐩稿簲鐨勯〉闈㈡渶鍚庤繑鍥炵粰鐢ㄦ埛銆?/font>
138199405_8b54d56b71_o.png



]]>
Spring絎旇涔嬪崄錛圫pring鐮旇鎬葷粨錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/29/149474.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Sat, 29 Sep 2007 02:07:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/29/149474.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/149474.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/29/149474.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/149474.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/149474.html</trackback:ping><description><![CDATA[ <font color="#0000ff">聽 聽聽</font> <font color="#0000ff" size="4">閫氳繃榪欏嚑澶╁Spring鐨勭爺璇伙紝鍓栨瀽浜哠pring鐨勫熀鏈牳蹇冩ā鍧椻斺擨oC鍜孉OP銆備粖澶╁皢瀵瑰叾浣滀釜鍩虹鎬х殑鎬葷粨銆?br /><br />聽聽聽聽 Spring 鏄竴涓紑婧愭鏋訛紝鏄負(fù)浜嗚В鍐充紒涓氬簲鐢ㄧ▼搴忓紑鍙戝鏉傛ц屽垱寤虹殑銆傛鏋剁殑涓昏浼樺娍涔嬩竴灝辨槸鍏跺垎灞傛灦鏋勶紝鍒嗗眰鏋舵瀯鍏佽鎮(zhèn)ㄩ夋嫨浣跨敤鍝竴涓粍浠訛紝妯″潡鏋勫緩鍦ㄦ牳蹇冨鍣ㄤ箣涓婏紝鏍稿績瀹瑰櫒瀹氫箟浜嗗垱寤恒侀厤緗拰綆$悊 bean 鐨勬柟寮?鍚屾椂涓?J2EE 搴旂敤紼嬪簭寮鍙戞彁渚涢泦鎴愮殑妗嗘灦銆傚叾涓綔涓篠pring鐨勬牳蹇冩ā鍧楀嵆鏄疭pring闈㈠悜鏂歸潰緙栫▼(AOP)鍜屾帶鍒跺弽杞?IOC)瀹瑰櫒銆係pring 璁捐鐨勬牳蹇冩槸 <code>org.springframework.beans</code> 鍖咃紝<code>BeanFactory</code><code>BeanFactory</code> 鏀寔涓や釜瀵硅薄妯″瀷鍗曟佸拰鍘熷瀷銆?code>BeanFactory</code>鏄疭pring浣滀負(fù)IOC 瀹瑰櫒鐨勫熀紜銆?br /><br />聽 聽 鎺у埗鍙嶈漿妯″紡錛氫笉鍒涘緩瀵硅薄錛屼絾鏄弿榪板垱寤哄畠浠殑鏂瑰紡銆傚湪浠g爜涓笉鐩存帴涓庡璞″拰鏈嶅姟榪炴帴錛屼絾鍦ㄩ厤緗枃浠朵腑鎻忚堪鍝竴涓粍浠墮渶瑕佸摢涓欏規(guī)湇鍔°傚鍣紙鍦?Spring 妗嗘灦涓槸 IOC 瀹瑰櫒錛夎礋璐e皢榪欎簺鑱旂郴鍦ㄤ竴璧楓傚湪鍏稿瀷鐨?IOC 鍦烘櫙涓紝瀹瑰櫒鍒涘緩浜嗘墍鏈夊璞★紝騫惰緗繀瑕佺殑灞炴у皢瀹冧滑榪炴帴鍦ㄤ竴璧鳳紝鍐沖畾浠涔堟椂闂磋皟鐢ㄦ柟娉曘侷OC 鐨勪竴涓疄鐜版ā寮?閫氳繃鎺ュ彛銆侀氳繃 JavaBean 鐨勫睘鎬с佷緷璧栨т互鏋勯犲嚱鏁扮殑褰㈠紡鎻愪緵銆?br /><br />聽聽聽 闈㈠悜鏂歸潰鐨勭紪紼嬶紝鍗?AOP錛屾槸涓縐嶇紪紼嬫妧鏈紝瀹冨厑璁哥▼搴忓憳瀵規(guī)í鍒囧叧娉ㄧ偣鎴栨í鍒囧吀鍨嬬殑鑱岃矗鍒嗙晫綰跨殑琛屼負(fù)錛堜緥濡傛棩蹇楀拰浜嬪姟綆$悊錛夎繘琛屾ā鍧楀寲銆侫OP 鐨勬牳蹇冩瀯閫犳槸鏂歸潰錛屽畠?yōu)畣閭d簺濯?jiǎng)鍝嶅涓被鐨勮涓哄皝瑁呭埌鍙噸鐢ㄧ殑妯″潡涓侫OP 鍜?IOC 鏄ˉ鍏呮х殑鎶鏈紝瀹冧滑閮借繍鐢ㄦā鍧楀寲鏂瑰紡瑙e喅浼佷笟搴旂敤紼嬪簭寮鍙戜腑鐨勫鏉傞棶棰樸傚湪鍏稿瀷鐨勯潰鍚戝璞″紑鍙戞柟寮忎腑錛屽彲鑳借灝嗘棩蹇楄褰曡鍙ユ斁鍦ㄦ墍鏈夋柟娉曞拰 Java 綾諱腑鎵嶈兘瀹炵幇鏃ュ織鍔熻兘銆傚湪 AOP 鏂瑰紡涓紝鍙互鍙嶈繃鏉ュ皢鏃ュ織鏈嶅姟妯″潡鍖栵紝騫朵互澹版槑鐨勬柟寮忓皢瀹冧滑搴旂敤鍒伴渶瑕佹棩蹇楃殑緇勪歡涓娿傚綋鐒?dòng)灱屼紭鍔繛鏄?Java 綾諱笉闇瑕佺煡閬撴棩蹇楁湇鍔$殑瀛樺湪錛屼篃涓嶉渶瑕佽冭檻鐩稿叧鐨勪唬鐮併傛墍浠ワ紝鐢?Spring AOP 緙栧啓鐨勫簲鐢ㄧ▼搴忎唬鐮佹槸鏉炬暎鑰﹀悎鐨勩侫OP 鐨勫姛鑳藉畬鍏ㄩ泦鎴愬埌浜?Spring 浜嬪姟綆$悊銆佹棩蹇楀拰鍏朵粬鍚勭鐗規(guī)х殑涓婁笅鏂囦腑銆?/font> <img src ="http://m.tkk7.com/improviser/aggbug/149474.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-29 10:07 <a href="http://m.tkk7.com/improviser/archive/2007/09/29/149474.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬩節(jié)錛圓OP in Spring錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/29/149406.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Fri, 28 Sep 2007 17:50:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/29/149406.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/149406.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/29/149406.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/149406.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/149406.html</trackback:ping><description><![CDATA[聽 聽 <font size="4"><font color="#0000ff">Spring IoC鍜?Spring AOP緇勫悎錛屼竴璧峰艦鎴愪簡Spring錛岃繖鏍蜂竴涓湁鏈烘暣浣擄紝浣垮緱鏋勫緩杞婚噺綰х殑J2EE鏋舵瀯鎴愪負(fù)鍙兘錛岃屼笖浜嬪疄璇佹槑錛岄潪甯告湁鏁堛傛病鏈塖pring IoC鐨凷pring AOP鏄笉瀹屽杽鐨勶紝娌℃湁Spring AOP鐨凷pring IoC鏄笉鍋ュ.鐨勩?鏈枃鐮旂┒Spring妗嗘灦涓殑闈㈠悜鏂歸潰緙?Aspect-Oriented Programming錛孉OP)錛岃繘鑰岄氳繃渚嬪瓙瑙f瀽濡備綍榪愮敤Spring涓殑鎵鏈夐氱煡綾誨瀷鍜屽垏鍏ョ偣鏉ュ疄鐜版洿瀹炵敤鐨勬柟闈㈠拰闈㈠悜鏂歸潰璁捐妯″紡銆?/font><br /><br />聽聽聽 <b><font color="#000080">AOP姒傚康錛?/font></b><br />聽聽聽 <font color="#000080"><b>Advice錛?/b></font><font color="#0000ff">濡備綍灝哹efore閫氱煡銆乤fterReturning閫氱煡鍜宎fterThrowing閫氱煡澹版槑涓篵ean銆?/font><br />銆<font color="#000080"><b>Pointcut</b></font><b>錛?/b><font color="#0000ff">濡備綍澹版槑闈欐佸垏鍏ョ偣閫昏緫浠ュ皢XML Spring Bean Configuration鏂囦歡涓殑鎵鏈夊唴瀹硅仈緋誨湪涓璧楓?</font><br />銆<font color="#000080"><b>Advisor錛?/b></font><font color="#0000ff">鍏寵仈鍒囧叆鐐瑰畾涔変笌閫氱煡bean鐨勬柟寮忋?/font><br /><br /><span style="font-size: 12pt; font-family: 瀹嬩綋;" lang="EN-US">聽聽聽 <font color="#0000ff">Spring AOP</font></span><font color="#0000ff"><span style="font-size: 12pt; font-family: 瀹嬩綋;">鏄嬌鐢ㄤ唬鐞嗘潵瀹屾垚鐨勶紝<span lang="EN-US">Spring </span>涓ょ鏂瑰紡錛?span lang="EN-US"></span><span lang="EN-US">JDK</span>鍔ㄦ佷唬鐞嗭紝闇瑕佽瀹氫竴緇勪唬鐞嗘帴鍙o紱<span lang="EN-US"></span><span lang="EN-US">CGLIB </span>浠g悊錛屽彲浠g悊鎺ュ彛鍜岀被銆?span lang="EN-US"></span><span lang="EN-US"></span><span lang="EN-US"></span></span>Spring鎻愪緵浜?縐岮dvice綾誨瀷錛欼nterception Around銆丅efore銆丄fter Returning銆乀hrow鍜孖ntroduction銆傚畠浠垎鍒湪浠ヤ笅鎯呭喌涓嬭璋冪敤錛氬湪JointPoint鍓嶅悗銆丣ointPoint鍓嶃? JointPoint鍚庛丣ointPoint鎶涘嚭寮傚父鏃躲丣ointPoint璋冪敤瀹屾瘯鍚庛?br /></font><br /><font color="#800080"><b>閰嶇疆鏂囦歡錛?/b></font></font><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="myAOPProxy"</span><span style="color: rgb(255, 0, 0);"><br />聽聽聽聽聽聽聽聽聽聽聽聽 class</span><span style="color: rgb(0, 0, 255);">="org.springframework.aop.framework.ProxyFactoryBean"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="proxyInterfaces"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">ITest</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="target"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">ref聽</span><span style="color: rgb(255, 0, 0);">local聽</span><span style="color: rgb(0, 0, 255);">=聽"test"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="interceptorNames"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">myPotincutAdvisor</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">14</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="test"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="Test"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">15</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">16</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="MyInterceptor"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="MethodTimeCostInterceptor"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">17</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">18</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="myPotincutAdvisor"</span><span style="color: rgb(255, 0, 0);"><br />聽聽聽聽聽聽聽聽聽聽聽聽 class</span><span style="color: rgb(0, 0, 255);">="org.springframework.aop.support.RegexpMethodPointcutAdvisor"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">19</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="advice"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">20</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">ref聽</span><span style="color: rgb(255, 0, 0);">local</span><span style="color: rgb(0, 0, 255);">="MyInterceptor"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">21</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">22</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="patterns"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">23</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">list</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">24</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">.*</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">25</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">.*</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">26</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">list</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">27</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">28</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">29</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span></div><br /><font size="4"><b><font color="#800080">鍒嗘瀽浠g爜錛?/font></b><br /><font color="#0000ff">1</font>銆?span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="myAOPProxy"</span><span style="color: rgb(255, 0, 0);"><br />聽聽聽聽 class</span><span style="color: rgb(0, 0, 255);">="org.springframework.aop.framework.ProxyFactoryBean"</span><span style="color: rgb(0, 0, 255);">>澹版槑娉ㄥ叆浜嗕唬鐞嗗疄渚媘yAOPProxy</span><span style="color: rgb(0, 0, 255);">銆?聽聽聽聽聽聽 <br />2銆?proxyInterfaces澹版槑灝嗚浠g悊鎺ュ彛ITest銆?/span><br /><span style="color: rgb(0, 0, 255);">3銆?target澹版槑琚唬鐞嗙洰鐨勭被銆?br /></span><font color="#0000ff">4</font>銆?<span style="color: rgb(0, 0, 255);">interceptorNames璁劇疆鎷︽埅鍣ㄤ負(fù)</span><span style="color: rgb(0, 0, 255);"></span><font color="#330000"><span style="color: rgb(0, 0, 0);">myPotincutAdvisor</span></font><span style="color: rgb(0, 0, 255);">銆?br />5銆?</span></font><span style="color: rgb(0, 0, 255);"><font size="4">patterns涓烘嫤鎴櫒璁劇疆閰嶅尮鏂瑰紡錛屽嵆鍦ㄦ墍琚厤鍖規(guī)垚鍔熺殑鏂規(guī)硶琚皟鐢ㄦ椂鎵ц鎷︽埅鍣ㄥ唴瀹廣?/font><br /><font size="4"><br /></font></span><font size="4">聽聽聽 </font><font color="#993300"><font size="4">璇ラ厤緗枃浠訛紝鎸囧畾瑕佸姞杞戒竴涓帴鍙d笌ITest鐩稿尮閰嶇殑bean銆傝bean闅忓悗琚叧鑱斿埌Test瀹炵幇綾匯傜湅璧鋒潵濂藉儚鏄垂浜嗗緢澶у姏姘斿彧涓轟簡鍔犺澆涓涓畝鍗曠殑bean騫惰皟鐢ㄤ竴涓柟娉曪紝浣嗘槸榪欎釜閰嶇疆鏂囦歡鍙槸浣? Spring妗嗘灦鍙互閫忔槑鍦板搴旂敤紼嬪簭搴旂敤鍏剁粍浠剁殑浼楀鐗規(guī)х殑涓涓綋鐜?/font>銆?/font><br /><img src ="http://m.tkk7.com/improviser/aggbug/149406.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-29 01:50 <a href="http://m.tkk7.com/improviser/archive/2007/09/29/149406.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬪叓錛圛nternationalization of spring錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/27/148476.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Wed, 26 Sep 2007 17:00:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/27/148476.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/148476.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/27/148476.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/148476.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/148476.html</trackback:ping><description><![CDATA[ <font size="4"> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <font size="4">聽聽聽 <font color="#cc0000" size="4">鍥介檯鍖栨敮鎸佸湪瀹為檯寮鍙戜腑鍙兘鏄渶甯哥敤鐨勭壒鎬э紝鏈枃鍒嗘瀽Spring鐨?/font></font> <font size="4"> </font> </span> <font color="#cc0000" size="4"> <span style="font-family: 瀹嬩綋;" lang="EN-US">ApplicationContext</span> </font> </font> <font color="#cc0000" size="4"> <span style="font-family: 瀹嬩綋;">鎻愪緵鍥介檯鍖栨敮鎸侊紝</span> <span style="font-family: 瀹嬩綋;">鍏舵彁渚涗簡鏇村姞寮哄ぇ鐨勫姛鑳斤紝濡備俊鎭殑鑷姩瑁呴厤浠ュ強(qiáng)鐑儴緗插姛鑳斤紙閰嶇疆鏂囦歡淇敼鍚庤嚜鍔ㄨ鍙栵紝鑰屾棤闇閲嶆柊鍚姩搴旂敤紼嬪簭錛夈?span lang="EN-US"><o:p></o:p></span></span> </font> <span style="font-family: 瀹嬩綋;"> <font color="#cc0000" size="4"> <br />聽聽聽 鐩墠<span lang="EN-US">Spring</span>涓彁渚涗簡涓や釜<span lang="EN-US"> MessageSource</span>鎺ュ彛鐨勫疄鐜幫紝鍗?span lang="EN-US">ResourceBundleMessageSource</span>鍜?span lang="EN-US">ReloadableResourceBundleMessageSource</span>錛屽悗鑰呮彁渚涗簡鏃犻渶閲嶅惎鍗沖彲閲嶆柊鍔犺澆閰嶇疆淇℃伅鐨勭壒鎬с?/font> <font size="5"> </font> <br /> </span> <span style="font-family: 瀹嬩綋;">聽聽聽 <br />聽聽聽<font color="#666600" size="4"> 鍦ㄤ笅闈㈢殑閰嶇疆鏂囦歡涓紝閫氳繃<span lang="EN-US">MessageResource</span>鐨勪竴涓疄鐜扮被<span lang="EN-US">org.springframework.context.support.ResourceBundleMessageSource</span>鏉ヨ幏寰楀浗闄呭寲鐨勪俊鎭?/font><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">description</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">Spring聽Quick聽Start</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">description</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="messageSource"</span><span style="color: rgb(255, 0, 0);"><br />聽聽聽聽 class</span><span style="color: rgb(0, 0, 255);">="org.springframework.context.support.ResourceBundleMessageSource"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="basenames"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">list</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">messages</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">list</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);"></span></div><br /></span> <p class="MsoNormal" style="text-indent: 21pt;"> <font color="#006600" size="4"> <span style="font-family: 瀹嬩綋;">榪欓噷澹版槑浜嗕竴涓悕涓?/span> <b style=""> <span style="font-family: 瀹嬩綋;" lang="EN-US">messageSource</span> </b> <span style="font-family: 瀹嬩綋;">鐨?span lang="EN-US">Bean</span>錛?/span> <b style=""> <span style="font-family: 瀹嬩綋;">娉ㄦ剰錛?/span> </b> </font> <font color="#006600"> <span style="font-family: 瀹嬩綋;"> <font size="4">瀵逛簬<span lang="EN-US">Message</span>瀹氫箟錛?span lang="EN-US">Bean ID</span>蹇呴』涓?span lang="EN-US">messageSource</span>錛岃繖鏄洰鍓?span lang="EN-US">Spring</span>鐨勭紪鐮佽綰︼級錛屽搴旂被涓?span lang="EN-US">ResourceBundleMessageSource</span>銆?/font> <span lang="EN-US"> <o:p> </o:p> </span> </span> </font> </p> <p class="MsoNormal" style="text-indent: 21pt;"> <span style="font-family: 瀹嬩綋;"> <font color="#663300" size="4">鑰屽叾涓殑<span lang="EN-US">basename</span>灞炴х敤渚嗚瀹氳祫婧愪俊鎭枃浠剁殑鍓嶇疆鏂囦歡鍚嶇О錛屽湪鏈緥涓負(fù)<span lang="EN-US">messages</span>銆?span lang="EN-US">Spring</span>浼?xì)鑷姩鍦?span lang="EN-US">CLASSPATH</span>鏍硅礬寰勪腑鎸夌収濡備笅欏哄簭鎼滃璧勬簮淇℃伅鏂囦歡騫惰繘琛屽姞杞斤紙浠?span lang="EN-US">Locale</span>涓?span lang="EN-US">zh_CN</span>涓轟緥錛屽叾瀹?span lang="EN-US">Spring</span>鍦ㄥ疄闄呬笂璋冪敤浜?span lang="EN-US">JDK</span>鐨?span lang="EN-US">ResourceBundle</span>璇誨彇閰嶇疆鏂囦歡錛?/font> <span lang="EN-US"> <font color="#339900" size="4">:</font> <o:p> </o:p> </span> </span> </p> <p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"> <font color="#333300" size="4"> <span style="font-family: 瀹嬩綋;" lang="EN-US">messages_zh_CN.properties<o:p></o:p></span> </font> </p> <p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"> <font color="#333300" size="4"> <span style="font-family: 瀹嬩綋;" lang="EN-US">messages_zh.properties<o:p></o:p></span> </font> </p> <p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"> <font color="#333300" size="4"> <span style="font-family: 瀹嬩綋;" lang="EN-US">messages.properties<o:p></o:p></span> </font> </p> <p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"> <font color="#333300" size="4"> <span style="position: relative; z-index: 1;"> </span> <span style="font-family: 瀹嬩綋;" lang="EN-US">messages_zh_CN.class<o:p></o:p></span> </font> <!--[endif]--> </p> <p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"> <font color="#333300" size="4"> <span style="font-family: 瀹嬩綋;" lang="EN-US">messages_zh.class<o:p></o:p></span> </font> </p> <p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"> <font color="#333300" size="4"> <span style="font-family: 瀹嬩綋;" lang="EN-US">messages.class</span> </font> </p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;"> <!--[if !supportLists]--> <font color="#330000" size="4"> <span style="font-family: 瀹嬩綋;">璧勬簮閰嶇疆淇℃伅鏂囦歡涓殑鍐呭</span> </font> </p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> <font size="3"> <span style="color: rgb(0, 128, 128);">1</span>聽<span style="color: rgb(0, 0, 0);">messages_zh_CN.properties錛?br /></span><span style="color: rgb(0, 128, 128);">2</span>聽<span style="color: rgb(0, 0, 0);">userinfo</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">褰撳墠鐧誨綍鐢ㄦ埛:聽</span><span style="color: rgb(128, 0, 0); font-weight: bold;">[</span><span style="color: rgb(128, 0, 0);">{0}</span><span style="color: rgb(128, 0, 0); font-weight: bold;">]</span><span style="color: rgb(0, 0, 0);">聽鐧誨綍鏃墮棿:</span><span style="color: rgb(128, 0, 0); font-weight: bold;">[</span><span style="color: rgb(128, 0, 0);">{1}</span><span style="color: rgb(128, 0, 0); font-weight: bold;">]</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">3</span>聽<span style="color: rgb(0, 0, 0);">messages_en_US.properties錛?br /></span><span style="color: rgb(0, 128, 128);">4</span>聽<span style="color: rgb(0, 0, 0);">userinfo</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">Current聽Login聽user:聽</span><span style="color: rgb(128, 0, 0); font-weight: bold;">[</span><span style="color: rgb(128, 0, 0);">{0}</span><span style="color: rgb(128, 0, 0); font-weight: bold;">]</span><span style="color: rgb(0, 0, 0);">聽Login聽time:</span><span style="color: rgb(128, 0, 0); font-weight: bold;">[</span><span style="color: rgb(128, 0, 0);">{1}</span><span style="color: rgb(128, 0, 0); font-weight: bold;">]</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">5</span>聽</font> <span style="color: rgb(0, 0, 0);"> </span> </div> <br />聽聽<b><font color="#333300">嫻嬭瘯浠g爜錛?/font></b><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><font size="3"><span style="color: rgb(0, 128, 128);">1</span>聽<span style="color: rgb(0, 0, 0);">ApplicationContext聽ctx</span><span style="color: rgb(0, 0, 0);"> = <br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileSystemXmlApplicationContext(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">bean.xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">2</span>聽<span style="color: rgb(0, 0, 0);">Object[]聽arg聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽Object[]<br /></span><span style="color: rgb(0, 128, 128);">3</span>聽<span style="color: rgb(0, 0, 0);">{聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Erica</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽Calendar.getInstance().getTime()<br /></span><span style="color: rgb(0, 128, 128);">4</span>聽<span style="color: rgb(0, 0, 0);">};<br /></span><span style="color: rgb(0, 128, 128);">5</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">浠ョ郴緇熼粯璁ocale鍔犺澆淇℃伅(瀵逛簬涓枃WinXP鑰岃█錛岄粯璁や負(fù)zh_CN)</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 128, 128);">6</span>聽<span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(0, 0, 0);">String聽msg聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽ctx.getMessage(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">userinfo</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽arg);<br /></span><span style="color: rgb(0, 128, 128);">7</span>聽<span style="color: rgb(0, 0, 0);">System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Message聽is聽===>聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">msg);<br /></span><span style="color: rgb(0, 128, 128);">8</span>聽</font><span style="color: rgb(0, 0, 0);"></span></div><br /><p class="MsoNormal" style="text-indent: 21pt;"><font color="#996600" face="Georgia" size="4"><span style="font-family: 瀹嬩綋;" lang="EN-US">浠g爜涓紝鎴戜滑灝嗕竴涓?span lang="EN-US">Object</span>鏁扮粍<span lang="EN-US">arg</span>浣滀負(fù)鍙傛暟浼犻掔粰<span lang="EN-US">ApplicationContext.getMessage</span>鏂規(guī)硶錛岃繖涓弬鏁頒腑鍖呭惈浜嗗嚭鐜板湪鏈緇堟枃瀛椾俊鎭腑鐨勫彲鍙樺唴瀹癸紝<span lang="EN-US">ApplicationContext</span>聽 灝嗘牴鎹弬鏁頒腑鐨?span lang="EN-US">Locale</span>淇℃伅瀵瑰叾榪涜澶勭悊錛堝閽堝涓嶅悓<span lang="EN-US">聽聽 Locale</span>璁懼畾鏃ユ湡杈撳嚭鏍煎紡錛夛紝騫剁敤鍏舵浛鎹㈤厤緗枃浠朵腑鐨?span lang="EN-US">{n}</span>鏍囪瘑錛?span lang="EN-US">n</span>浠h〃鍙傛暟鏁扮粍涓殑绱㈠紩錛屼粠<span lang="EN-US">1聽 </span>寮濮嬶級銆?span lang="EN-US"><o:p></o:p></span><br /></span></font></p><p class="MsoNormal" style="text-indent: 21pt;"><font color="#996600" face="Georgia" size="4"><span style="font-family: 瀹嬩綋;" lang="EN-US">榪愯涓婇潰鐨勪唬鐮侊紝寰楀埌浠ヤ笅杈撳嚭鐨勫唴瀹癸細(xì)<span lang="EN-US"><o:p></o:p></span><br />聽聽 Message is ===> |</span></font><font color="#996600" face="Georgia" size="4"><span style="font-family: 瀹嬩綋;">矛銆兟?span lang="EN-US">?</span>擄<span lang="EN-US">|</span>矛<span lang="EN-US">???</span>簍<span lang="EN-US">???</span>銆?span lang="EN-US">: [Erica] |</span>矛<span lang="EN-US">???</span>簍<span lang="EN-US">o</span>銆兟?span lang="EN-US">??:[07-9-27 </span>涓婂崍1<span lang="EN-US">:27]</span></span></font></p><p class="MsoNormal" style="text-indent: 21pt;"><font color="#996600" face="Georgia" size="4"><span style="font-family: 瀹嬩綋;" lang="EN-US">閽堝<span lang="EN-US">ResourceBundle</span>鐨勭紪鐮佽繃紼嬩腑鍙戠敓鐨勯棶棰樸傝繖鏄敱浜庤漿鐮佽繃紼嬩腑浜х敓鐨勭紪鐮侀棶棰樺紩鍙戠殑銆傛瘮杈冪畝鍗曠殑瑙e喅鍔炴硶鏄氳繃<span lang="EN-US">JDK</span>鎻愪緵鐨勮漿鐮佸伐鍏?span lang="EN-US">native2ascii.exe</span>聽 榪涜杞崲銆傛墽琛岋細(xì)<span lang="EN-US"><o:p></o:p></span>native2ascii messages_zh_CN.properties msg.txt銆?o:p></o:p></span></font><font color="#996600" face="Georgia" size="4">鍐嶇敤<span lang="EN-US">msg.txt</span>鏂囦歡鏇挎崲<span lang="EN-US">Messages_zh_CN.properties</span>聽聽聽聽聽聽 鏂囦歡銆?/font><font face="Georgia"><br /></font></p><font color="#996600" face="Georgia" size="4"><span style="font-family: 瀹嬩綋;">聽聽 鍐嶆榪愯紺轟緥浠g爜錛屽緱鍒版紜緭鍑猴細(xì)<span lang="EN-US"><o:p></o:p></span></span></font><p class="MsoNormal"><font color="#996600" face="Georgia" size="4"><span style="font-family: 瀹嬩綋;" lang="EN-US">聽聽 Message is ===> </span><span style="font-family: 瀹嬩綋;">褰撳墠鐧誨綍鐢ㄦ埛<span lang="EN-US">: [Erica] </span>鐧誨綍鏃墮棿<span lang="EN-US">:[07-9-27 </span>涓婂崍<span lang="EN-US">1:30]<o:p></o:p></span></span></font></p><p class="MsoNormal" style="text-indent: 21pt;"><font color="#996600" face="Georgia" size="4"><span style="font-family: 瀹嬩綋;">灝濊瘯鍦ㄤ唬鐮佷腑鎸囧畾涓嶅悓鐨?span lang="EN-US">Locale</span>鍙傛暟錛?span lang="EN-US"><o:p></o:p></span></span></font></p><p class="MsoNormal" style="text-indent: 21pt;"><font color="#996600" face="Times New Roman" size="4"><span style="font-family: 瀹嬩綋;"><font face="Georgia">String msg = ctx.getMessage("userinfo", arg, Locale.US);<o:p></o:p>鍐嶆榪愯錛屽彲浠ョ湅鍒幫細(xì)</font><span lang="EN-US"><o:p></o:p></span></span></font></p><p class="MsoNormal" style="text-indent: 21pt;"><font color="#996600" face="Times New Roman" size="4"><span style="font-family: 瀹嬩綋;" lang="EN-US">Message is ===> Current Login user: [Erica] Login time::[9/27/07 1:35AM]</span></font></p><p class="MsoNormal" style="text-indent: 21pt;"><b><font color="#663300" face="Times New Roman" size="4"><span style="font-family: 瀹嬩綋;">鍙錛屽墠鑰呮牴鎹綋鍓嶉粯璁?span lang="EN-US">Locale"zh_CN"</span>錛?span lang="EN-US">getMessage</span>鏂規(guī)硶鑷姩鍔犺澆浜?span lang="EN-US">messages_zh_CN.properties</span>鏂囦歡錛涘悗鑰?/span><font face="Georgia"><span style="font-size: 10.5pt; font-family: 瀹嬩綋;" lang="EN-US">getMessage</span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鏂規(guī)硶鏍規(guī)嵁鎸囧畾緙栫爜<span lang="EN-US">"en_US"</span>鍔犺澆浜?span lang="EN-US">messages_en_US.properties</span>鏂囦歡銆?/span></font></font></b></p><font color="#996600" face="Times New Roman" size="4"><br /><span style="font-family: 瀹嬩綋;"><br /><span lang="EN-US"><o:p></o:p></span></span></font><p class="MsoNormal" style="text-indent: 21pt;"><span style="font-family: 瀹嬩綋;"><br /><span lang="EN-US"><o:p></o:p></span></span></p><b style=""><span style="font-family: 瀹嬩綋;"><span lang="EN-US"><o:p></o:p></span></span></b><img src ="http://m.tkk7.com/improviser/aggbug/148476.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-27 01:00 <a href="http://m.tkk7.com/improviser/archive/2007/09/27/148476.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬩竷錛圱ypes of Injection錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/26/148472.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Wed, 26 Sep 2007 15:59:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/26/148472.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/148472.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/26/148472.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/148472.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/148472.html</trackback:ping><description><![CDATA[ <p> <b>鏈枃鐮旂┒Spring鐨勪笁縐嶄緷璧栨敞鍏ュ疄鐜扮被鍨?/b>鈥斺?b style=""><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鎺ュ彛娉ㄥ叆錛?span lang="EN-US">Interface Injection</span>錛夈?/span></b><b style=""><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">璁懼兼敞鍏ワ紙<span lang="EN-US">Setter Injection</span>錛夈?/span></b><b style=""><span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鏋勯犲瓙娉ㄥ叆錛?span lang="EN-US">Constructor Injection</span>錛夈?/span></b></p> <p> <b style=""> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;" lang="EN-US">Type1 </span> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鎺ュ彛娉ㄥ叆錛?/span> </b> <font color="#663300" size="2"> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;">浼犵粺鐨勫垱寤烘帴鍙e璞$殑鏂規(guī)硶錛?/span> </font> <font color="#663300"> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鍊熷姪鎺ュ彛鏉ュ皢璋冪敤鑰呬笌瀹炵幇鑰呭垎紱匯傚涓嬮潰鐨勪唬鐮佹墍紺猴細(xì)</span> </font> </p> <p> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> <span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽ClassA聽<br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);">{<br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽InterfaceB聽clzB;<br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽doSomething()聽<br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">{<br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">Ojbect聽obj聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽Class.forName(Config.BImplementation).newInstance();<br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">clzB聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(InterfaceB)obj;<br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">clzB.doIt();<br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">}<br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">鈥︹?br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">}<br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);"></span></div> <br /> </span> </p> <p> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> </span> </p> <p class="MsoNormal" style="text-indent: 21pt;"> <font color="#33cc00" size="4"> <span style="font-family: 瀹嬩綋;">鍦ㄤ唬鐮佷腑鍒涘緩<span lang="EN-US">InterfaceB</span>瀹炵幇綾葷殑瀹炰緥錛屽茍灝嗚瀵硅薄璧嬩簣<span lang="EN-US">clzB</span>銆備篃灝辨槸渚濇嵁<span lang="EN-US">Java</span>涓殑瀵硅薄鍔ㄦ佸鎬佹妧鏈細(xì)<span lang="EN-US"><o:p></o:p></span>InterfaceB clzB=new InterfaceBImpleClass();涓轟簡灝嗚皟鐢ㄨ呬笌瀹炵幇鑰呭湪緙栬瘧鏈熷垎紱伙紝浜庢槸鏈変簡涓婇潰鐨勪唬鐮侊紝鎴戜滑鏍規(guī)嵁棰勫厛鍦ㄩ厤緗枃浠朵腑璁懼畾鐨勫疄鐜扮被鐨勭被鍚?span lang="EN-US">(Config.BImplementation)</span>錛屽姩鎬?span lang="EN-US"><o:p></o:p></span>鍔犺澆瀹炵幇綾伙紝騫墮氳繃<span lang="EN-US">InterfaceB</span>寮哄埗杞瀷鍚庝負(fù)<span lang="EN-US"> ClassA</span>鎵鐢ㄣ?/span> </font> </p> <p class="MsoNormal" style="text-indent: 21pt;"> </p> <p class="MsoNormal" style="text-indent: 21pt;"> <span style="font-family: 瀹嬩綋;"> </span> <br /> <b style=""> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;" lang="EN-US"> <br />Type2 </span> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;">璁懼兼敞鍏ワ細(xì)</span> </b> <font color="#663300" size="3"> <span style="font-family: 瀹嬩綋;">鍦ㄥ悇縐嶇被鍨嬬殑渚濊禆娉ㄥ叆妯″紡涓紝璁懼兼敞鍏ユā寮忓湪瀹為檯寮鍙戜腑寰楀埌浜嗘渶騫挎硾鐨勫簲鐢紙鍏朵腑寰堝ぇ涓閮ㄥ垎寰楀姏浜?span lang="EN-US">Spring</span>妗嗘灦鐨?/span> </font> <font color="#663300"> <br /> </font> <span style="font-family: 瀹嬩綋;"> <font color="#663300" size="3">褰卞搷錛夈?span lang="EN-US"><o:p></o:p></span>浣跨敤<span lang="EN-US">IoC</span>鐨?span lang="EN-US">Setter</span>娉ㄥ皠錛屼竴浜涘閮ㄥ厓鏁版嵁琚敤浜庤В鍐充緷璧栨ч棶棰樸傚茍涓斿湪<span lang="EN-US">Spring</span>涓紝榪欑鍏冩暟鎹噰鍙栦簡綆鍗曠殑<span lang="EN-US">XML</span>閰嶇疆鏂囦歡鐨勫艦寮忋?/font> <span lang="EN-US"> <o:p> </o:p> </span> </span> <br /> <b style=""> <span style="font-family: 瀹嬩綋;"> <br />聽涓嬮潰涓烘煇涓被鐨勭ず渚嬩唬鐮?span lang="EN-US"><o:p></o:p></span></span> </b> <span style="font-family: 瀹嬩綋;"> <br />聽<font size="4">(鍏朵腑鍖呭惈鏈変竴涓?span lang="EN-US">message</span>灞炴э紝璇ョ被閫氳繃鍏?span lang="EN-US">setMessage()</span>鏂規(guī)硶鑾峰緱鍙沖鍣ㄦ墍鎻愪緵鐨勫箋?</font></span> </p> <p class="MsoNormal" style="text-indent: 21pt;"> </p> <p class="MsoNormal"> </p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> <span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽UpperAction聽聽</span><span style="color: rgb(0, 0, 255);">implements</span><span style="color: rgb(0, 0, 0);">聽Action<br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);">{<br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽String聽message;<br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽String聽getMessage()聽<br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽{<br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">聽message;<br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">聽聽}<br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽setMessage(String聽string)聽<br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽{<br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽message聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽string;<br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽}<br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">}<br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);"></span></div> <br /> <span style="font-family: 瀹嬩綋;"> </span> <b style=""> <span style="font-family: 瀹嬩綋;" lang="EN-US">聽</span> </b> <font size="3"> <span style="font-family: 瀹嬩綋;" lang="EN-US"> <font color="#663300">鍏朵腑message</font> </span> </font> <font color="#663300" size="3"> <span style="font-family: 瀹嬩綋;"> 灞炴х殑鍊奸氳繃閰嶇疆鏂囦歡鏉ユ彁渚? </span> </font> <p class="MsoNormal"> </p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> <span style="color: rgb(0, 128, 128);">1</span>聽<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="theUpperAction"</span><span style="color: rgb(255, 0, 0);">聽聽class</span><span style="color: rgb(0, 0, 255);">="springj2seapp.UpperAction"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">2</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="message"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">3</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">HeLLo,UpperAction聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">4</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">5</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">6</span>聽<span style="color: rgb(0, 0, 0);"></span></div> <br /> <span style="font-family: 瀹嬩綋;"> </span> <b style=""> <span style="font-family: 瀹嬩綋;"> <span lang="EN-US"> <o:p> </o:p> </span> </span> </b> <b style=""> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;" lang="EN-US">Type3 </span> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鏋勯犲瓙娉ㄥ叆錛?/span> </b> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <font color="#660000">鍦?span lang="EN-US">Type3</span>綾誨瀷鐨勪緷璧栨敞鍏ユ満鍒朵腑錛屼緷璧栧叧緋繪槸閫氳繃綾繪瀯閫犲嚱鏁板緩绔嬶紝瀹瑰櫒閫氳繃璋冪敤綾葷殑鏋勯犳柟娉曪紝灝嗗叾鎵闇鐨勪緷璧栧叧緋繪敞鍏ュ叾涓?/font> <br /> </span> <b style=""> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <br />紺轟緥浠g爜錛?br />閰嶇疆鏂囦歡濡備笅<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="exampleBean"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="examples.ExampleBean"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">ref聽</span><span style="color: rgb(255, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">="anotherExampleBean"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">ref聽</span><span style="color: rgb(255, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">="yetAnotherBean"</span><span style="color: rgb(0, 0, 255);">/></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg聽</span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="int"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="anotherExampleBean"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="examples.AnotherBean"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="yetAnotherBean"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="examples.YetAnotherBean"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">14</span>聽<span style="color: rgb(0, 0, 0);"></span></div><br /><br /></span> </b> <b> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <span style="color: rgb(0, 0, 0);">ExampleBean浠g爜錛?/span> </span> </b> <br /> <b style=""> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <br /> </span> </b> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> <span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽ExampleBean聽<br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);">{<br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽AnotherBean聽beanOne;<br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽YetAnotherBean聽beanTwo;<br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">聽i;<br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽ExampleBean(AnotherBean聽anotherBean,聽YetAnotherBean聽yetAnotherBean, <br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">聽i)聽<br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">{<br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.beanOne聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽anotherBean;<br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.beanTwo聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽yetAnotherBean;<br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.i聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽i;<br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽}<br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">}<br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);"></span></div> </span> <span style="font-family: 瀹嬩綋;"> <br /> <font color="#336600" size="4">褰撴瀯閫犳柟娉曚腑甯﹀涓笉鍚岀殑鍩烘湰鏁版嵁綾誨瀷鐨勫弬鏁版椂錛屼負(fù)浜嗛伩鍏嶄駭鐢熶簩涔夋э紝鍙互閲囩敤<span lang="EN-US">type</span>鎴栬?span lang="EN-US">index</span>鏉ユ寚瀹氭瀯閫犳柟娉曠殑鍙傛暟鐨勭被鍨嬪拰欏哄簭銆?/font> <font size="4"> <br />濡傦細(xì)</font> <br />聽聽 <b>type鏂規(guī)硶</b><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">1</span>聽<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg聽</span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="int"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">2</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">7500000</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">3</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">4</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg聽</span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="java.lang.String"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">5</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">42</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">6</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">7</span>聽<span style="color: rgb(0, 0, 0);"></span></div><span lang="EN-US"><o:p></o:p></span></span> <br /> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;">聽聽聽 <b><font color="#330000">index鏂規(guī)硶</font></b><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">1</span>聽<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="exampleBean"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="examples.ExampleBean"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">2</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg聽</span><span style="color: rgb(255, 0, 0);">index</span><span style="color: rgb(0, 0, 255);">="0"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">3</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">7500000</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">4</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">5</span>聽<span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg聽</span><span style="color: rgb(255, 0, 0);">index</span><span style="color: rgb(0, 0, 255);">="1"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">6</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">42</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">7</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">8</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">9</span>聽<span style="color: rgb(0, 0, 0);"></span></div><br /><font color="#663300"><b>鎬葷粨錛?/b></font></span> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <br />聽聽聽聽 <font size="3"><b><font color="#003300">type1鍦ㄧ伒媧繪с佹槗鐢ㄦт笂涓嶅鍏朵粬涓ょ娉ㄥ叆妯″紡錛?/font></b></font></span> <b> <font color="#003300" size="4"> <font size="3"> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;" lang="EN-US">Type2</span> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鍜?span lang="EN-US">Type3</span>鍨嬬殑渚濊禆娉ㄥ叆瀹炵幇鍒欐槸鐩墠涓繪祦鐨?span lang="EN-US">IOC</span>瀹炵幇妯″紡錛?/span> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;" lang="EN-US">Type3</span> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;">鍜?span lang="EN-US">Type2</span>妯″紡鍚勬湁鍗冪錛岃?span lang="EN-US">Spring</span>閮藉<span lang="EN-US">Type3</span>鍜?span lang="EN-US">Type2</span>綾誨瀷鐨勪緷璧栨敞鍏ユ満鍒舵彁渚涗簡鑹ソ鏀寔銆?/span> <span style="font-family: 瀹嬩綋;">浠?span lang="EN-US">Type3</span>綾誨瀷涓轟富錛岃緟涔嬩互<span lang="EN-US">Type2</span>綾誨瀷鏈哄埗浣滀負(fù)琛ュ厖錛屽彲浠ヨ揪鍒版渶濂界殑渚濊禆娉ㄥ叆鏁堟灉錛屼笉榪囧浜庡熀浜?span lang="EN-US">Spring Framework</span>寮鍙戠殑搴旂敤鑰岃█錛?span lang="EN-US">Type2</span>浣跨敤鏇村姞騫挎硾銆?span lang="EN-US"><o:p></o:p></span></span> </font> </font> <i> <font color="#003300" size="4"> </font> </i> </b> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> <br /> </span> <p> <b style=""> <span style="font-size: 10.5pt; font-family: 瀹嬩綋;"> </span> </b> </p> <img src ="http://m.tkk7.com/improviser/aggbug/148472.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-26 23:59 <a href="http://m.tkk7.com/improviser/archive/2007/09/26/148472.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬪叚錛圛oC Singleton錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/26/148298.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Wed, 26 Sep 2007 05:22:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/26/148298.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/148298.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/26/148298.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/148298.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/148298.html</trackback:ping><description><![CDATA[ <div align="justify">聽聽聽<font color="#333300"><b style=""><font size="4">Spring涓瑽eanFactory<span style="font-family: 瀹嬩綋;">鏀寔涓や釜瀵硅薄妯″瀷</span></font><span style="font-family: 瀹嬩綋;"><span lang="EN-US"><o:p></o:p></span></span></b></font></div> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;" align="justify"> <!--[if !supportLists]--> <font color="#333300"> <span style="font-family: Wingdings;" lang="EN-US"> <span style=""> <span style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </span> </span> </span> </font> <!--[endif]--> <font color="#333300"> <b> <span style="font-family: 瀹嬩綋;">鍗曟侊細(xì)</span> </b> <span style="font-family: 瀹嬩綋;"> <font size="4">妯″瀷鎻愪緵浜嗗叿鏈夌壒瀹氬悕縐扮殑瀵硅薄鐨勫叡浜疄渚嬶紝鍙互鍦ㄦ煡璇㈡椂瀵瑰叾榪涜媯(gè)绱€?span lang="EN-US">Singleton </span>鏄粯璁ょ殑涔熸槸鏈甯哥敤鐨勫璞℃ā鍨嬨傚浜庢棤鐘舵伮犅?鏈嶅姟瀵硅薄寰堢悊鎯熾?/font> <span lang="EN-US"> <o:p> </o:p> </span> </span> </font> </p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;" align="justify"> <!--[if !supportLists]--> <font color="#333300"> <span style="font-family: Wingdings;" lang="EN-US"> <span style=""> </span> </span> <b> <span style="font-family: 瀹嬩綋;">鍘熷瀷錛?/span> <font size="4"> </font> </b> <font size="4"> <span style="font-family: 瀹嬩綋;">妯″瀷紜繚姣忔媯(gè)绱㈤兘浼?xì)鍒涘缓鍗曠嫭鐨勫璞°傚湪姣忎釜鐢ㄦ埛閮介渶瑕佽嚜宸辯殑瀵硅薄鏃訛紝鍘熷瀷妯″瀷鏈閫傚悎銆?/span> </font> </font> </p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;" align="justify"> <span style="font-family: 瀹嬩綋;"> <b> <font color="#333300" size="4">瀹炰緥錛?/font> <font size="4"> </font> </b> <br /> </span> </p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> <span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">聽聽beans聽聽</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);">聽non-singleton聽examples聽</span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="nonSingleton"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="java.lang.String"</span><span style="color: rgb(255, 0, 0);">聽singleton</span><span style="color: rgb(0, 0, 255);">="true"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">Value</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽<br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">singleton錛氭寚瀹氭JavaBean鏄惁閲囩敤鍗曚緥錛圫ingleton錛夋ā寮忥紝濡傛灉璁句負(fù)"true"錛屽垯鍦˙eanFactory浣滅敤鑼冨洿鍐咃紝鍙淮鎶ゆJavaBean聽聽鐨勪竴涓疄渚嬶紝浠g爜閫氳繃BeanFactory聽聽聽鑾峰緱姝avaBean聽聽瀹炰緥鐨勫紩鐢ㄣ傚弽涔嬶紝濡傛灉璁句負(fù)"false"錛屽垯閫氳繃BeanFactory鑾峰彇姝ava聽Bean聽聽瀹炰緥鏃訛紝BeanFactory姣忔閮藉皢鍒涘緩涓涓柊鐨勫疄渚嬭繑鍥炪?/span></div> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;">聽聽聽 </p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> <span style="color: rgb(0, 128, 128);">聽聽聽聽 1</span>聽<span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽NonSingleton聽{<br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽main(String[]聽args)聽{<br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);">聽<br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">BeanFactory聽factory聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽XmlBeanFactory(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileSystemResource(<br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">build/beans.xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽String聽s1聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(String)factory.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">nonSingleton</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽String聽s2聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(String)factory.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">nonSingleton</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Identity聽Equal?:聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽(s1聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">s2));<br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Value聽Equal:?聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽s1.equals(s2));<br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽System.out.println(s1);<br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽System.out.println(s2);<br /></span><span style="color: rgb(0, 128, 128);">14</span>聽<span style="color: rgb(0, 0, 0);">聽}<br /></span><span style="color: rgb(0, 128, 128);">15</span>聽<span style="color: rgb(0, 0, 0);">}</span></div> <p> </p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;">聽聽 <i><b><font size="4"><font color="#003300">鍒嗘瀽緇撴灉錛?/font></font></b></i></p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;">聽聽 <font color="#009900">Identity Equal?: true<br />Value Equal:? true<br />Value<br />Value</font><br /></p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;">聽聽 鐢辯粨鏋滃彲浠ョ湅鍑虹敱fantory浜х敓鐨刡ean瀵硅薄鍙湁涓涓?br /><span style="font-family: 瀹嬩綋;"></span></p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;"> <span style="font-family: 瀹嬩綋;"> <br /> </span> </p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;"> </p> <p class="MsoNormal" style="text-indent: 21pt;"> <b> <span style="font-family: 瀹嬩綋;">聽<font color="#ff0000"> 娉ㄦ剰</font>錛?/span> </b> <font size="4"> <span style="font-family: 瀹嬩綋;"> <font color="#33cc00">鍦?span lang="EN-US">Spring</span>涓秷闄や簡鐢辯敤鎴瘋嚜宸辨潵瀹炵幇<span lang="EN-US">Singleton</span>妯″紡鐨勫簲鐢紝<span lang="EN-US">Spring Bean</span>鐨勭己鐪佽涓哄氨鏄?span lang="EN-US">Singleton</span>錛屼笉蹇呭啀涓轟簡<span lang="EN-US">Singleton</span>緙栫爜銆?/font> <span lang="EN-US"> <o:p> </o:p> </span> </span> </font> </p> <p class="MsoNormal" style="margin-left: 42pt; text-indent: -21pt;"> <br /> <span style="font-family: 瀹嬩綋;"> <span lang="EN-US"> <o:p> </o:p> </span> </span> </p> <img src ="http://m.tkk7.com/improviser/aggbug/148298.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-26 13:22 <a href="http://m.tkk7.com/improviser/archive/2007/09/26/148298.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬩簲錛圚ierarchical Bean Factory Usage錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/25/147934.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Mon, 24 Sep 2007 16:05:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/25/147934.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/147934.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/25/147934.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/147934.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/147934.html</trackback:ping><description><![CDATA[ <strong> <span style="font-size: 14pt;"> <span style="color: rgb(24, 38, 255);">鏈枃鐮旂┒Spring鍒嗗眰Bean Factory鐢ㄦ硶錛屽厛鐪嬫湁鍏充唬鐮侊細(xì)</span> </span> </strong> <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> <span style="color: rgb(0, 128, 128);">聽1</span> parent<span style="color: rgb(0, 0, 0);">.xml<br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 255);"><!</span><span style="color: rgb(255, 0, 255);">DOCTYPE聽beans聽PUBLIC聽"-//SPRING//DTD聽BEAN//EN" <br /> 聽聽聽聽聽 "http://www.springframework.org/dtd/spring-beans.dtd"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="injectBean"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="java.lang.String"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">Bean聽In聽Parent</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="injectBeanParent"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="java.lang.String"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">Bean聽In聽Parent</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">14</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">15</span>聽<span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">聽 <br /></span></div> <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> <span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 0);">beans.xml<br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 255);"><!</span><span style="color: rgb(255, 0, 255);">DOCTYPE聽beans聽PUBLIC聽"-//SPRING//DTD聽BEAN//EN" <br /> 聽聽聽 "http://www.springframework.org/dtd/spring-beans.dtd"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);">聽hierarchical聽bean聽factories聽</span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="target1"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="SimpleTarget"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="val"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">ref聽</span><span style="color: rgb(255, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">="injectBeanParent"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="target2"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="SimpleTarget"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="val"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">14</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">ref聽</span><span style="color: rgb(255, 0, 0);">local</span><span style="color: rgb(0, 0, 255);">="injectBean"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">15</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">16</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">17</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">18</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="target3"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="SimpleTarget"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">19</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property聽</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="val"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">20</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">ref聽</span><span style="color: rgb(255, 0, 0);">parent</span><span style="color: rgb(0, 0, 255);">="injectBean"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">21</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">22</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">23</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">24</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="injectBean"</span><span style="color: rgb(255, 0, 0);">聽class</span><span style="color: rgb(0, 0, 255);">="java.lang.String"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">25</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">26</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">Bean聽In聽Child</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">27</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">28</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">29</span>聽<span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">30</span>聽</div> <br /> <h1> <strong> <code> <font color="#000000"> <span style="color: rgb(24, 38, 255);">SimpleTarget涓彧鏈変竴灞炴tring val</span> </font> </code> </strong> </h1> <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> <span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽main(String[]聽args)聽{<br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽BeanFactory聽parent聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽XmlBeanFactory(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileSystemResource(<br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">build/parent.xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽BeanFactory聽child聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽XmlBeanFactory(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileSystemResource(<br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">build/beans.xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">),聽parent);<br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽SimpleTarget聽target1聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(SimpleTarget)聽child.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">target1</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽SimpleTarget聽target2聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(SimpleTarget)聽child.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">target2</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽SimpleTarget聽target3聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(SimpleTarget)聽child.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">target3</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽System.out.println(target1.getVal());<br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽System.out.println(target2.getVal());<br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽System.out.println(target3.getVal());<br /></span><span style="color: rgb(0, 128, 128);">14</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽}</span></div> <br /> <strong> <font size="4"> <span style="color: rgb(24, 38, 255);">榪愯緇撴灉錛?/span> </font> </strong> <br /> <span style="color: rgb(24, 38, 255);"> <font size="4">Bean In Parent<br /> Bean In Child<br /> Bean In Parent</font> <br /> <br /> <font size="4"> <b> 鍒嗘瀽榪囩▼錛?/b> </font> <br /> <font size="4"> 鍦╞ean factory琚姞杞借繃紼嬩腑鍒嗗埆鍔犺澆鍚勫眰Bean Factory錛?/font> </span> <font size="4"> <span style="color: rgb(0, 0, 0);">BeanFactory聽parent聽</span> <span style="color: rgb(0, 0, 0);">=</span>聽<span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽XmlBeanFactory(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileSystemResource(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">build/parent.xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br /></span><span style="color: rgb(0, 0, 0);">BeanFactory聽child聽</span><span style="color: rgb(0, 0, 0);">=</span>聽<span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽XmlBeanFactory(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileSystemResource(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">build/beans.xml</span><span style="color: rgb(0, 0, 0);">"</span></font> <span style="color: rgb(0, 0, 0);"> <font size="4">),聽<span style="color: rgb(255, 0, 0);">parent</span>);<br /></font> <span style="color: rgb(24, 38, 255);"> <font size="4">鍏朵腑parent鍙傛暟鎸囧畾浜哹ean factory闂寸殑鐖跺瓙鍏崇郴銆?/font> <br /> <br /> <font size="4"> <b> 鍒嗘瀽緇撴灉錛?/b> </font> <br /> <font size="4"> 絎竴琛岀粨鏋滀負(fù)鍦ㄧ埗factory涓畾涔夌殑鍙傛暟錛岃鏄庡湪瀛恌antory涓彲浠ョ洿鎺ヨ皟鐢ㄧ埗fantory鍏冪礌錛岀被浼間簬java涓殑緇ф壙鍏崇郴銆?br /> 絎簩琛岀粨鏋滆鏄?/font> </span> </span> <font size="4"> <span style="color: rgb(0, 0, 255);"><</span> <span style="color: rgb(128, 0, 0);">ref聽</span> <span style="color: rgb(255, 0, 0);">local</span> <span style="color: rgb(0, 0, 255);">="injectBean"</span> <span style="color: rgb(0, 0, 255);">/>涓璴ocal鎸囧悜鏈琭antory鍏冪礌銆?br /> 絎笁琛岀粨鏋滀負(fù)Bean In Parent錛岃鏄?/span> <span style="color: rgb(0, 0, 255);"><</span> <span style="color: rgb(128, 0, 0);">ref聽</span> <span style="color: rgb(255, 0, 0);">parent</span> <span style="color: rgb(0, 0, 255);">="injectBean"</span> <span style="color: rgb(0, 0, 255);">/>涓璸arent鎸囧悜鐖秄antory涓厓绱犮?/span> </font> <br /> <br /> <br /> <br /> <img src ="http://m.tkk7.com/improviser/aggbug/147934.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-25 00:05 <a href="http://m.tkk7.com/improviser/archive/2007/09/25/147934.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬪洓錛圫pring Event錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/24/147914.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Mon, 24 Sep 2007 14:38:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/24/147914.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/147914.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/24/147914.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/147914.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/147914.html</trackback:ping><description><![CDATA[     鎽樿: Spring涓彁渚涗竴浜汚ware鐩稿叧鐨勬帴鍙o紝BeanFactoryAware銆?ApplicationContextAware銆丷esourceLoaderAware銆丼ervletContextAware絳夌瓑錛屽叾涓渶甯哥敤鍒扮殑鏄疉pplicationContextAware銆傚疄鐜癆pplicationContextAware鐨凚ean錛屽湪Bean琚垵濮嬪悗錛屽皢浼?xì)琚敞鍏?ApplicationContext鐨勫疄渚嬨侫pplicationContextAware鎻愪緵浜唒ublishEvent()鏂規(guī)硶錛屽疄鐜癘bserver(瑙傚療鑰?璁捐妯″紡鐨勪簨浠朵紶鎾満錛屾彁渚涗簡閽堝Bean鐨勪簨浠朵紶鎾姛鑳姐傞氳繃Application.publishEvent鏂規(guī)硶錛屾垜浠彲浠ュ皢浜嬩歡閫氱煡緋葷粺鍐呮墍鏈夌殑ApplicationListener銆?nbsp; <a href='http://m.tkk7.com/improviser/archive/2007/09/24/147914.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/improviser/aggbug/147914.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-24 22:38 <a href="http://m.tkk7.com/improviser/archive/2007/09/24/147914.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬩笁錛圲sage of property config錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/24/147777.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Mon, 24 Sep 2007 05:51:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/24/147777.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/147777.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/24/147777.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/147777.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/147777.html</trackback:ping><description><![CDATA[     鎽樿: 鏈枃鍐呭婕旂ず灞炴ф枃浠剁敤娉曠殑綆鍗曚緥瀛愩?<br>棣栧厛瀹氫箟妯″瀷鎺ュ彛Model錛岃鍥炬帴鍙iew錛屼互鍙?qiáng)瀹冧滑瀹炵幇绫籌mpModel錛孖mpView. <br>Model涓畾涔夋柟娉昰etString();View涓畾涔塎odel瀹炰緥涓哄叾灞炴э紝鍦ㄥ疄鐜扮被ImpView涓疄鐜版柟娉?<br>disPlay(),鍏舵柟娉曚綋涓篗odel瀹炰緥鐨刧etString()鏂規(guī)硶錛屽茍灝嗗叾鎵撳嵃鍑烘潵銆?nbsp; <a href='http://m.tkk7.com/improviser/archive/2007/09/24/147777.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/improviser/aggbug/147777.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-24 13:51 <a href="http://m.tkk7.com/improviser/archive/2007/09/24/147777.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬩簩錛圕ollection Injection錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/24/147710.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Mon, 24 Sep 2007 02:23:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/24/147710.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/147710.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/24/147710.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/147710.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/147710.html</trackback:ping><description><![CDATA[     鎽樿: 閫氳繃<list/>,<set/>,<map/>浠ュ強(qiáng)<props/>鍏冪礌瀹氫箟鍜岃緗笌java collection綾誨瀷瀵瑰簲鐨凩ist錛孲et錛孧ap錛孯properties鐨勫箋?nbsp; <a href='http://m.tkk7.com/improviser/archive/2007/09/24/147710.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/improviser/aggbug/147710.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-24 10:23 <a href="http://m.tkk7.com/improviser/archive/2007/09/24/147710.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring絎旇涔嬩竴錛堝垵鎺pring錛?/title><link>http://m.tkk7.com/improviser/archive/2007/09/24/147650.html</link><dc:creator>improviser</dc:creator><author>improviser</author><pubDate>Sun, 23 Sep 2007 17:31:00 GMT</pubDate><guid>http://m.tkk7.com/improviser/archive/2007/09/24/147650.html</guid><wfw:comment>http://m.tkk7.com/improviser/comments/147650.html</wfw:comment><comments>http://m.tkk7.com/improviser/archive/2007/09/24/147650.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://m.tkk7.com/improviser/comments/commentRss/147650.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/improviser/services/trackbacks/147650.html</trackback:ping><description><![CDATA[聽聽聽<font color="#333300" size="4"></font><span style="font-size: 10.5pt; font-family: 瀹嬩綋;"><span style="font-family: Comic Sans MS;"><span style="font-family: Arial;"><span style="font-family: Comic Sans MS;"><span style="font-size: 12pt;"><span style="font-size: 18pt;"><span style="font-family: Verdana;"><span style="font-family: Comic Sans MS;"><span style="font-size: 10.5pt; font-family: 瀹嬩綋;"><span><span style="font-size: 10.5pt; font-family: 瀹嬩綋;"><span style="font-size: 24pt;"><span style="font-size: 14pt;"><span style="font-size: 10pt;"><span style="font-size: 10.5pt; font-family: 瀹嬩綋;"><font color="#333300" size="4">鍒濇帰Spring紼嬪簭錛岀▼搴忓涓嬶細(xì)</font><br /><br /> 聽聽聽聽 </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 0);">BeanNaming.java<br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">package</span><span style="color: rgb(0, 0, 0);">聽spring.beantest;<br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽org.springframework.beans.factory.BeanFactory;<br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽org.springframework.beans.factory.xml.XmlBeanFactory;<br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽org.springframework.core.io.FileSystemResource;<br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽BeanNaming聽{<br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽main(String聽[]args)<br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽{<br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽BeanFactory聽factory聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽XmlBeanFactory(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileSystemResource(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">src/applicationContext.xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽String聽s1聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(String)factory.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name1</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">14</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽String聽s2聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(String)factory.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name2</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">15</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽String聽s3聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(String)factory.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name3</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">16</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽String聽s4聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(String)factory.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name4</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">17</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">18</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽System.out.println((s1聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽s2));<br /></span><span style="color: rgb(0, 128, 128);">19</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽System.out.println((s2聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽s3));<br /></span><span style="color: rgb(0, 128, 128);">20</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽System.out.println((s3聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽s4));<br /></span><span style="color: rgb(0, 128, 128);">21</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">22</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽String[]聽x聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽factory.getAliases(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name3</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">23</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(String聽str:x)<br /></span><span style="color: rgb(0, 128, 128);">24</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽{<br /></span><span style="color: rgb(0, 128, 128);">25</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽System.out.println(str);<br /></span><span style="color: rgb(0, 128, 128);">26</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽}<br /></span><span style="color: rgb(0, 128, 128);">27</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">28</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽}<br /></span><span style="color: rgb(0, 128, 128);">29</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽}<br /></span><span style="color: rgb(0, 128, 128);">30</span>聽<span style="color: rgb(0, 0, 0);">聽<br /></span><span style="color: rgb(0, 128, 128);">31</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽applicationContext.xml<br /></span><span style="color: rgb(0, 128, 128);">32</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);"><?</span><span style="color: rgb(0, 0, 0);">xml聽version</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">1.0</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽encoding</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">UTF-8</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">?></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">33</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);"><!</span><span style="color: rgb(0, 0, 0);">DOCTYPE聽beans聽PUBLIC聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">-//SPRING//DTD聽BEAN//EN</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://www.springframework.org/dtd/spring-beans.dtd</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">34</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">beans</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">35</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);"><!--</span><span style="color: rgb(0, 0, 0);">聽aliasing聽examples聽</span><span style="color: rgb(0, 0, 0);">--></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">36</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">bean聽id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name1</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name2,name3,name4</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">java.lang.String</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">37</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);"></</span><span style="color: rgb(0, 0, 0);">beans</span><span style="color: rgb(0, 0, 0);">></span></div><br /> 聽聽聽 <font size="4"><span style="color: red;">杈撳嚭緇撴灉涓猴細(xì)</span><br /><span style="color: rgb(24, 125, 255);"> 聽聽聽 true<br /> 聽聽聽 true<br /> 聽聽聽 true<br /> 聽聽聽 name1<br /> 聽聽聽 name4<br /> 聽聽聽 name2</span></font><br /> 聽聽聽 <br /> 聽聽聽 <font size="4"><span style="color: rgb(74, 48, 255);">鍙互鐪嬪嚭錛屼嬌鐢ㄤ腑id灞炴у拰name灞炴у嚑涔庢病鏈変換浣曞尯鍒傝皟鐢╞eanfactory.getAliases(string)鐨勬柟娉曟椂錛屼紶鍏ョ殑鍙傛暟鍙互鏄換鎰忎竴涓猙ean鍚嶅瓧錛岃緭鍑虹殑鍒悕鍒欐槸闄ゅ幓浣滀負(fù)鍙傛暟鏈韓涔嬪鐨勬墍鏈? bean鍚嶃?/span><br /> 聽聽 <br /><br /> 聽聽 <span style="color: rgb(24, 38, 255);">鍙?/span>錛?span style="color: rgb(74, 48, 255);">鍦ㄥ啓 applicationContxt.xml鏂囦歡鏃訛紝濡傛灉娌℃湁瀹氫箟<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">錛屽垯浼?xì)鎶涘?/span><span style="color: red;"><span style="color: rgb(14, 0, 0);"><span style="color: red;">Cannot find the declaration of element 'beans'</span></span></span><span style="color: rgb(74, 48, 255);">寮傚父銆?/span></font><br /> 聽聽 <br /> 聽聽 聽聽聽<strong><font size="4"><span style="color: rgb(107, 40, 255);">浠ヤ笂浣跨敤BeanFactory瀵歸厤緗枃浠惰繘琛屽姞杞斤紝BeanFactory錛屾槸鏍規(guī)嵁閰嶇疆鏂囦歡璐熻矗鍒涘緩Bean鐨勫疄渚嬶紝騫惰礋璐ean鐨勭敓鍛藉懆鏈熺殑綆$悊- --錛屽寘鎷珺ean鐨勭敓鎴愪笌閿姣併丅ean鐨勫垱寤烘柟寮忕殑璇嗗埆錛堟槸鍚︿負(fù)singleton錛夈丅ean鐨勫悇涓睘鎬х殑璁懼畾銆佷緷璧栧叧緋葷殑寤虹珛絳夈?br /> 聽聽聽 ApplicationContext鎺ュ彛錛屾彁渚涗簡鍥介檯鍖栥佷簨浠跺鐞嗗強(qiáng)beans鍦╟ontext涓殑鑷煡鑳藉姏銆傚畠涔熷彲鍒涘緩鍏鋒湁灞傛緇撴瀯context鐜? 澧冿紝灝哹ean鐨勪綔鐢ㄥ煙鍜屽彲璁塊棶鍖哄煙闄愬埗鍦ㄥ簲鐢ㄧ▼搴忕殑涓涓壒瀹氶儴鍒嗕腑銆備笅闈㈡紨紺哄浣曚嬌鐢ˋpplicationContext鎺ュ彛銆?/span></font><br /></strong><br /> 聽聽聽 <br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);">聽1</span>聽<span style="color: rgb(0, 0, 0);"><!</span><span style="color: rgb(0, 0, 0);">DOCTYPE聽beans聽PUBLIC聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">-//SPRING//DTD聽BEAN//EN</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://www.springframework.org/dtd/spring-聽聽聽聽beans.dtd</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽2</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">beans</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽3</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">bean聽id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">bean_1</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">BeanTest</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽4</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">bean聽id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">bean_2</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">BeanTest</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽5</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 0);"></</span><span style="color: rgb(0, 0, 0);">beans</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽6</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽7</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">聽8</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽BeanTest聽{<br /></span><span style="color: rgb(0, 128, 128);">聽9</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽test()聽{<br /></span><span style="color: rgb(0, 128, 128);">10</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">test..</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">11</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽}<br /></span><span style="color: rgb(0, 128, 128);">12</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽}<br /></span><span style="color: rgb(0, 128, 128);">13</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">14</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">15</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽</span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽org.springframework.context.ApplicationContext;<br /></span><span style="color: rgb(0, 128, 128);">16</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽</span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽org.springframework.context.support.FileSystemXmlApplicationContext;<br /></span><span style="color: rgb(0, 128, 128);">17</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">18</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽BeanNameExample聽{<br /></span><span style="color: rgb(0, 128, 128);">19</span>聽<span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">20</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽main(String[]聽args)聽{<br /></span><span style="color: rgb(0, 128, 128);">21</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽ApplicationContext聽ctx聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileSystemXmlApplicationContext(<br /></span><span style="color: rgb(0, 128, 128);">22</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">build/applicationContext.xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">23</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">24</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽BeanTest聽beanOne聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(BeanTest)ctx.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">bean_1</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">25</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽BeanTest聽beanTwo聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(BeanTest)ctx.getBean(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">bean_2</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);">26</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽<br /></span><span style="color: rgb(0, 128, 128);">27</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽beanOne.test();<br /></span><span style="color: rgb(0, 128, 128);">28</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽beanTwo.test();<br /></span><span style="color: rgb(0, 128, 128);">29</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽}<br /></span><span style="color: rgb(0, 128, 128);">30</span>聽<span style="color: rgb(0, 0, 0);">聽聽聽}<br /></span><span style="color: rgb(0, 128, 128);">31</span>聽</div> 聽聽<font size="4"><span style="color: rgb(107, 40, 255);"><strong>緇間笂錛孉pplicationContext涓嶣eanFactory鐨勪笉鍚岀偣<br /> 聽聽 BeanFactory鎻愪緵浜嗛拡瀵笿avaBean鐨勭鐞嗗姛鑳斤紝鑰孉pplicationContext鎻愪緵浜嗕竴涓洿涓烘鏋跺寲鐨勫疄鐜幫紙浠庝笂闈㈢殑紺轟緥涓彲浠? 鐪嬪嚭錛孊eanFactory鐨勪嬌鐢ㄦ柟寮忔洿鍔犵被浼間竴涓狝PI錛岃岄潪Framework style錛夈侫pplicationContext瑕嗙洊浜咮eanFactory鐨勬墍鏈夊姛鑳斤紝騫舵彁渚涗簡鏇村鐨勭壒鎬с傛澶栵紝 ApplicationContext涓轟笌鐜版湁搴旂敤妗嗘灦鐩告暣鍚堬紝鎻愪緵浜嗘洿涓哄紑鏀懼紡鐨勫疄鐜幫紙濡傚浜嶹eb搴旂敤錛屾垜浠彲浠ュ湪web.xml涓 ApplicationContext榪涜閰嶇疆錛夈?/strong></span></font><strong></strong><img src ="http://m.tkk7.com/improviser/aggbug/147650.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/improviser/" target="_blank">improviser</a> 2007-09-24 01:31 <a href="http://m.tkk7.com/improviser/archive/2007/09/24/147650.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://mmm19.com" target="_blank">久久亚洲AV永久无码精品</a>| <a href="http://wdjiuye.com" target="_blank">日韩a毛片免费观看</a>| <a href="http://socgl.com" target="_blank">亚洲欧洲自拍拍偷精品 美利坚</a>| <a href="http://dd99com.com" target="_blank">免费无码一区二区三区</a>| <a href="http://eddiekidd.com" target="_blank">xvideos永久免费入口</a>| <a href="http://www-gogo.com" target="_blank">亚洲熟妇AV一区二区三区浪潮</a>| <a href="http://lanchenews.com" target="_blank">亚洲gv白嫩小受在线观看</a>| <a href="http://gsonlinet.com" target="_blank">人人狠狠综合久久亚洲高清</a>| <a href="http://tccqdy.com" target="_blank">成年女性特黄午夜视频免费看 </a>| <a href="http://biarn.com" target="_blank">日韩精品人妻系列无码专区免费 </a>| <a href="http://yuanzhouxh.com" target="_blank">免费视频爱爱太爽了</a>| <a href="http://wyj4.com" target="_blank">今天免费中文字幕视频</a>| <a href="http://zbvip888.com" target="_blank">乱人伦中文视频在线观看免费</a>| <a href="http://wwwjjz.com" target="_blank">久久亚洲国产成人影院</a>| <a href="http://mtripmall.com" target="_blank">亚洲美女激情视频</a>| <a href="http://hn283.com" target="_blank">亚洲成AV人片一区二区</a>| <a href="http://kdp44.com" target="_blank">久久亚洲国产成人精品无码区</a>| <a href="http://56kaifa.com" target="_blank">免费国产综合视频在线看</a>| <a href="http://0359jgyy.com" target="_blank">成人免费视频网址</a>| <a href="http://626393.com" target="_blank">日韩视频在线精品视频免费观看</a>| <a href="http://cdhxfj.com" target="_blank">久草免费福利资源站</a>| <a href="http://cz655.com" target="_blank">国产免费一区二区三区免费视频</a>| <a href="http://bjgjjrxy.com" target="_blank">免费精品视频在线</a>| <a href="http://2266511.com" target="_blank">黄色一级免费网站</a>| <a href="http://qmoread.com" target="_blank">美女被免费视频网站</a>| <a href="http://snsdtv.com" target="_blank">精品国产亚洲第一区二区三区</a>| <a href="http://jmdehong.com" target="_blank">亚洲码欧美码一区二区三区</a>| <a href="http://scycho.com" target="_blank">亚洲www77777</a>| <a href="http://9981tv.com" target="_blank">亚洲午夜无码毛片av久久京东热</a>| <a href="http://onisterwines.com" target="_blank">亚洲人成影院午夜网站</a>| <a href="http://cz655.com" target="_blank">亚洲欧洲高清有无</a>| <a href="http://16lds.com" target="_blank">亚洲人成人77777网站不卡</a>| <a href="http://linmh.com" target="_blank">亚洲一级毛片免费看</a>| <a href="http://bjyaao.com" target="_blank">亚洲性线免费观看视频成熟</a>| <a href="http://jjesqc.com" target="_blank">亚洲娇小性色xxxx</a>| <a href="http://499k.com" target="_blank">亚洲中文字幕无码爆乳app</a>| <a href="http://zjpcyh.com" target="_blank">亚洲精品无码久久久久久</a>| <a href="http://wwwby1378.com" target="_blank">日韩欧美亚洲中文乱码</a>| <a href="http://delvheng.com" target="_blank">黄页网址在线免费观看</a>| <a href="http://wwwxue1888.com" target="_blank">特级毛片A级毛片100免费播放</a>| <a href="http://wusongtv.com" target="_blank">最好2018中文免费视频</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>