锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲永久中文字幕在线,亚洲依依成人亚洲社区,亚洲天堂2016http://www.tkk7.com/yesjoy/category/17091.html<font color="red">鈽?lt;/font><font color="blue">鎬誨湪鐖北 鎵浠ヨ壈杈?鎬誨湪瀵繪ⅵ 鎵浠ヨ嫤鐥?lt;/font><font color="red">鈽?lt;/font>zh-cnMon, 06 Sep 2010 04:38:44 GMTMon, 06 Sep 2010 04:38:44 GMT60Spring MVC妗嗘灦鐨勯珮綰ч厤緗?/title><link>http://www.tkk7.com/yesjoy/articles/107020.html</link><dc:creator>鈽厃esjoy鈽?/dc:creator><author>鈽厃esjoy鈽?/author><pubDate>Wed, 28 Mar 2007 08:57:00 GMT</pubDate><guid>http://www.tkk7.com/yesjoy/articles/107020.html</guid><wfw:comment>http://www.tkk7.com/yesjoy/comments/107020.html</wfw:comment><comments>http://www.tkk7.com/yesjoy/articles/107020.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/yesjoy/comments/commentRss/107020.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/yesjoy/services/trackbacks/107020.html</trackback:ping><description><![CDATA[ <span id="r5tfvhl" class="h1b">Spring MVC妗嗘灦鐨勯珮綰ч厤緗?br /><br /></span>杞創鏉ヨ嚜錛?a >http://dev2dev.bea.com.cn/techdoc/2006068810.html</a><br /><br /><table cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td height="64">鏃墮棿錛?006-06-08<br />浣滆咃細<a >Dejan Bosanac</a><br />嫻忚嬈℃暟錛? <script language="JavaScript" src="/beadevcount.jsp?d_id=162307" type="text/JavaScript"></script> 7201 <br />鏈枃鍏抽敭瀛楋細<a >Spring</a>,聽<a >configuration</a>,聽<a href="http://dev2dev.bea.com.cn/products/search.jsp?searchtype=keywords&keywords=source control">source control</a>,聽<a >CVS</a>,聽<a >subversion</a>,聽<a >閰嶇疆</a>,聽<a href="http://dev2dev.bea.com.cn/products/search.jsp?searchtype=keywords&keywords=婧愪唬鐮佹帶鍒?>婧愪唬鐮佹帶鍒?/a></td><td><table class="box_content" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td><span id="b531vbl" class="h2b">鏂囩珷宸ュ叿</span><br /><img height="10" alt="鎺ㄨ崘緇欐湅鍙? src="http://dev2dev.bea.com.cn/images/letter001.gif" width="19" align="absMiddle" />聽<a href="javascript:sendmail()">鎺ㄨ崘緇欐湅鍙?/a><br /><img height="18" alt="鎵撳嵃鏂囩珷" src="http://dev2dev.bea.com.cn/images/print001.gif" width="19" align="absMiddle" />聽<a href="javascript:window.print()">鎵撳嵃鏂囩珷</a></td></tr></tbody></table></td></tr></tbody></table><!-- 鎻愬彇鎶鏈枃绔?--><div id="x5zhnff" class="beas"><img height="1" alt="" src="http://dev2dev.bea.com.cn/images/dot6B6B6B.gif" width="100%" /></div><p>銆銆鏈枃灝嗕負鎮ㄦ彁渚涘叧浜?a target="_blank">Spring MVC妗嗘灦</a>鐨勯厤緗妧宸э紝浠ュ府鍔╃鐞嗗熀浜嶴pring鐨剋eb搴旂敤紼嬪簭鐨勫涓疄渚嬨傛湰閰嶇疆綆$悊涓婚甯歌瀛︽湳鐣屾墍蹇界暐錛屼絾鏄紝榪欏浜庣幇瀹炵殑web寮鍙戝挨涓洪噸瑕併傛湰涓婚騫朵笉鐩存帴鍏寵仈浠諱綍鍏蜂綋鐨勬妧鏈紝鍥犳錛屾垜浠皢浠庢渶鍩烘湰鐨勬蹇靛紑濮嬪榪欎釜闂榪涜璇存槑銆備笅闈紝鎴戜滑灝嗘牴鎹甋pring MVC妗嗘灦錛屼負鍩轟簬鏈妧鏈紑鍙戠殑欏圭洰鎻愪緵涓緋誨垪鐨勮В鍐蟲柟妗堛?/p><h1>Spring閰嶇疆</h1><p>銆銆浜轟滑緇忓父浼氬湪涓鍙頒互涓婄殑涓繪満涓婇厤緗竴縐峎eb搴旂敤紼嬪簭銆備緥濡傦紝鍦ㄧ敓浜т腑錛屼竴涓綉绔欏彲鑳藉彧鏈変竴涓疄渚嬨傞櫎浜嗘瀹炰緥澶栵紝寮鍙戜漢鍛樺彲浠ュ湪鐢ㄤ簬寮鍙戠殑鏈哄櫒涓婇厤緗叾浠栫殑錛堝紑鍙戯級瀹炰緥銆備篃鍙互鍦ㄥ叕鍙革紙鏈烘瀯錛夊唴閮ㄧ殑鏈湴寮鍙戞湇鍔″櫒涓婄淮鎶ゅ叾浠栧簲鐢ㄧ▼搴忚緗紝榪欏皢璁╂偍鍙楃泭鍖祬銆傝瀹炰緥鐨勭洰鐨勬槸浣縒eb璁捐鑰呭彲浠ヨ幏寰楁湁璐ㄩ噺淇濊瘉鐨勬潗鏂欙紝騫朵負闇瑕佷負搴旂敤紼嬪簭鎻愪緵鏂囦歡璧勬枡鐨勪漢鎻愪緵鍑嗗叆銆?/p><p>銆銆澶у閮界煡閬擄紝鍗充嬌鏄渶綆鍗曠殑鍦烘櫙錛屼篃闇瑕佸畨瑁呫侀厤緗拰緇存姢涓変釜瀹炰緥銆傝屽浜庝綅浜庝笉鍚屽湴鐞嗕綅緗殑鍥㈤槦鏉ヨ錛岃浠庝簨榪欐牱鐨勯」鐩究鏇村姞鍥伴毦銆傚浜庝換浣曚笉鏄壒鍒畝鍗曠殑Web搴旂敤紼嬪簭欏圭洰錛岄兘闇瑕佸鍚嶅紑鍙戜漢鍛樻潵瀹夎欏圭洰瑁呯疆鍜屾湰鍦拌緗互鍙婅繍琛屽崟鍏冩祴璇曠殑瑁呯疆絳夈?/p><p>銆銆寰堝緇勭粐閮藉皢鑷繁寮鍙戠殑浜у搧浣滀負Web搴旂敤紼嬪簭銆傛垜浠彲浠ュ湪寰堝浜у搧涓彂鐜拌繖縐嶆儏鍐碉紝渚嬪鐢靛瓙鍟嗗姟緋葷粺銆?a target="_blank">鍐呭綆$悊</a>緋葷粺錛圕MS錛夛紝浠ュ強鍗氬鍙戝竷騫沖彴絳夈傝繖綾諱駭鍝佸彲鍦ㄥ涓湇鍔″櫒涓繘琛岄儴緗層傚浜庢垚鍔熺殑澶氱敤閫擶eb搴旂敤紼嬪簭鏉ヨ錛屼粬浠殑寮鍙戜漢鍛樺繀欏昏淇濊瘉浠栦滑鐨勫簲鐢ㄧ▼搴忎究浜庡畨瑁咃紝騫朵笖鑳藉涓庡叾浠朩eb搴旂敤紼嬪簭瀹岀編闆嗘垚銆傜粡榪囦笂榪拌璁轟箣鍚庯紝鎴戜滑搴旇鏄庝簡錛屼綔涓烘湰鏂囦富棰樼殑搴旂敤紼嬪簭閰嶇疆鏄氱敤Web搴旂敤紼嬪簭欏圭洰寮鍙戜漢鍛樻墍闇瑕佽В鍐崇殑閲嶈闂涔嬩竴銆?/p><p>銆銆璇稿CVS鎴朣ubversion涔嬬被鐨勭増鏈帶鍒剁郴緇熸槸寮鍙戠粍緇囦嬌鐢ㄧ殑涓縐嶆爣鍑嗗伐鍏楓傝繖縐嶅伐鍏蜂唬琛ㄤ簡涓浜涚粍緇囩殑涓績婧愪唬鐮佺増鏈簱錛屽畠浠鐢ㄤ簬淇濇寔婧愪唬鐮佺殑鏈夊簭銆傜敤鎴峰彲浠ヨ窡韙簲鐢ㄧ▼搴忔簮浠g爜鐨勫彉鍖栵紝鏄劇ず涓嶅悓鐗堟湰鐨勫尯鍒紝騫跺彲浠ョ‘瀹氶」鐩垎鏀傝屼笖錛屽畠浠嬌寰楀湪搴旂敤紼嬪簭閮ㄧ講涓繘琛岄儴鍒嗘洿鏂版垚涓哄彲鑳姐?/p><p>銆銆寰堟槑鏄撅紝鐗堟湰鎺у埗緋葷粺杞歡鏄窡韙簮浠g爜鎵蹇呴渶鐨勶紝瀹冨浜庤В鍐沖簲鐢ㄧ▼搴忛厤緗棶棰樻湁闈炲父澶х殑甯姪銆傚湪鏈枃涓紝鎴戜滑灝嗕笉浼氭妸閲嶇偣鏀懼湪鐗堟湰鎺у埗緋葷粺涓婏紝鍥犱負榪欐柟闈㈠凡緇忔湁寰堝鐩稿叧鐨勬潗鏂欎簡銆傚湪姝わ紝鎴戜滑灝嗗叧娉ㄧ増鏈帶鍒墮棶棰樹腑鐨勪竴涓皬璇濋錛氬浣曚嬌Web搴旂敤紼嬪簭鐨勯厤緗洿鍔犱究鎹鳳紙灝ゅ叾鏄嬌鐢⊿pring MVC妗嗘灦緙栧啓鐨刉eb搴旂敤紼嬪簭錛夈?/p><p>銆銆闂鏄細鎴戜滑鍦ㄦ璁ㄨ鐨勬槸涓縐嶄粈涔堟牱鐨勯厤緗紵浠諱綍Web搴旂敤紼嬪簭閮介渶瑕佷竴浜涜祫婧愶紝榪欎簺璧勬簮閫氬父閮芥槸鍏舵墍榪愯鐨勬湇鍔″櫒鎵鐗規湁鐨勶紝渚嬪鏁版嵁搴揢RL銆佸彂閫佺數瀛愰偖浠剁殑SMTP鏈嶅姟鍣紝浠ュ強鍖呭惈涓撶敤杞歡鏂囦歡鐨勬枃浠跺す絳夈傝繖鏍風殑璁劇疆搴旇闆嗕腑錛屼粠鑰屼嬌搴旂敤紼嬪簭閰嶇疆鏇村姞綆鍗曘?/p><p>銆銆浣嗘槸錛岃繖鍙槸榪欎釜闂鏈綆鍗曠殑涓縐嶇増鏈傛湁鏃跺欙紝鍦ㄥ簲鐢ㄧ▼搴忓紑鍙戜腑闇瑕佹洿鍔犲鏉傜殑閰嶇疆銆傝繖鎰忓懗鐫錛屽繀欏誨皢鍚勬閮ㄧ講涓殑涓嶅悓Bean榪炴帴璧鋒潵錛岃岃繖浼氫嬌闂鏇村姞澶嶆潅銆?/p><p>銆銆榪欎簺搴旂敤紼嬪簭閰嶇疆闂鐨勮В鍐蟲柟妗堟湁璇稿浼樺娍錛屽寘鎷細綆鍖栧簲鐢ㄧ▼搴忕殑瀹夎鍜岄厤緗繃紼嬶紝浣挎簮浠g爜鐗堟湰鎺у埗鏇村姞綆渚匡紝鍑忓皯婧愪唬鐮佺増鏈簱涓殑鍐茬獊鐜拌薄銆備笅闈紝鎴戜滑灝嗛氳繃紺轟緥璇︾粏璁ㄨ榪欎釜璇濋銆?/p><h1>闂</h1><p>銆銆鎴戜滑棣栧厛鏉ユ紨紺轟竴涓嬩笂鏂囨墍鎻愬埌鐨勬渶綆鍗曠殑鐗堟湰銆傚湪榪欎竴鍦烘櫙涓紝鎴戜滑甯屾湜鍦ㄥ簲鐢ㄧ▼搴忛儴緗蹭腑鏀瑰彉鐨勬槸綆鍗曠殑閰嶇疆鍙傛暟錛屼緥濡傞摼鎺ャ佸瘑鐮佺瓑銆傚鏋滄偍鏇劇粡浣跨敤Spring MVC妗嗘灦寮鍙戣繃Web搴旂敤紼嬪簭錛岄偅涔堟偍搴旇鐭ラ亾榪欓噷灝嗙敤鍒扮殑涓や釜閰嶇疆鏂囦歡錛?/p><ul><li>/WEB-INF/applicationContext.xml錛屽畠璁╂偍鍙互閰嶇疆Bean錛屾垨鑰呮樉紺哄簲鐢ㄧ▼搴忎笂涓嬫枃銆傞氳繃榪欎釜鏂囦歡錛屾偍鍙互瀹氫箟鑷繁鐨勪笟鍔¢昏緫Bean銆佽祫婧愪互鍙婂叾浠栧彲浠ヤ笌Web绔彛鐩稿叧鑱旂殑鎵鏈塀ean銆? </li><li>/WEB-INF/<strong>[servlet-name]</strong>-servlet.xml錛屽畠琚敤浜庨厤緗甒eb灞傘佽鍥捐В鏋愬櫒銆佹帶鍒跺櫒銆佹牎楠屽櫒浠ュ強鍏朵粬鎵鏈塎VC妗嗘灦涓繀闇鐨凚ean銆?strong>[servlet-name]鎸囩殑鏄湪</strong>web.xml閮ㄧ講鎻忚堪絎︿腑瀹氫箟鐨?strong>Spring </strong>dispatcher servlet鐨勫悕縐般?</li></ul><p>銆銆閭d箞闂鍦ㄥ摢鍎垮憿錛熼棶棰樺氨鍑哄湪applicationContext.xml涓皢鍖呮嫭涓浜涚壒瀹氫簬涓繪満鐨凚ean瀹氫箟銆傚叾涓紝鏈鏄庢樉鐨勪竴涓ず渚嬪氨鏄寘鍚簡JDBC榪炴帴淇℃伅鐨刡ean錛屼絾鏄換浣曚竴縐嶇◢寰鏉備簺鐨勫簲鐢ㄧ▼搴忛兘鏈夊崄鍑犱釜綾諱技鐨凚ean銆傜湅涓涓嬩笅闈㈢殑紺轟緥錛?/p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000"><</span><span style="COLOR: #000000">bean聽id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">dataSource</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.springframework.jdbc.datasource.DriverManagerDataSource</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">property聽name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">driverClassName</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">org.postgresql.Driver</span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">property</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">property聽name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">url</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">jdbc:postgresql:</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">localhost/test</value></span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">聽聽聽</span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">property</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">property聽name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">username</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">postgres</span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">property</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">property聽name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">password</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">></</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">property</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">bean</span><span style="COLOR: #000000">></span></div></pre><p>銆銆榪欎釜瑙e喅鏂規鐨勯棶棰樺湪浜庡applicationContext.xml鏂囦歡鐨勭淮鎶ゃ傚浜庡垵瀛﹁呮潵璇達紝璁炬兂涓涓嬶紝欏圭洰鏀懼湪婧愪唬鐮佺増鏈帶鍒剁郴緇熶腑錛屼緥濡侰VS銆備笅闈紝鍋囪鎮ㄥ笇鏈涘湪緗戠珯涓坊鍔犳柊鐨勫姛鑳斤紝閭d箞灝遍渶瑕佸湪搴旂敤紼嬪簭涓婁笅鏂囧畾涔変腑娣誨姞棰濆鐨凚ean瀹氫箟銆傞棶棰樻槸濡備綍鍦ㄧ敓浜ф湇鍔″櫒涓婁綋鐜拌繖浜涙敼鍙樸?/p><p>銆銆閫氬父鎯呭喌涓嬶紝搴旂敤紼嬪簭鐨勬湰鍦板疄渚嬩笉浼氫笌媧誨姩绔欑偣浣跨敤鍚屾牱鐨勬暟鎹簱錛屽洜姝pplicationContext.xml鏂囦歡灝嗗寘鎷鎮ㄨ兘澶熻闂湰鍦版暟鎹簱鐨勮緗傚綋鎮ㄦ兂鎻愪氦鍦ㄦ簮浠g爜鐗堟湰搴撲腑鐨勬敼鍙樻椂錛屽氨闇瑕佹敞鎰忚繖浜涚壒瀹氫簬涓繪満灞炴х殑鍚屾鎬с傜増鏈簱涓殑鏂囦歡鏈緇堝彲鑳戒嬌鐢ㄦ湰鍦拌緗腑鐨勯厤緗傚鏋滄兂鍦ㄧ敓浜ф湇鍔″櫒涓婃洿鏂伴厤緗紝灝卞繀欏繪墜鍔ㄥ悓姝ヨ繖浜涘睘鎬х殑鍊箋傝繖鏄潪甯告灟鐕ョ殑浠誨姟錛岃屼笖榪橀潪甯稿鏄撳嚭閿欍?/p><p>銆銆瀵逛簬搴旂敤紼嬪簭鐨勬瘡涓疄渚嬫潵璇達紝榪欎釜闂鏇村姞閲嶈銆傚亣濡傛湁涓変綅寮鍙戜漢鍛樻鍦ㄤ嬌鐢ㄤ唬鐮佹鍩哄潃錛岃屼笖浠栦滑浣跨敤鐨勬槸鏈湴鐨勬暟鎹簱銆傚綋鎮ㄦ彁浜ゆ洿鏀圭殑鏃跺欙紝浠栦滑姣忎釜浜哄湪鏈湴鏈嶅姟鍣ㄤ笂鏇存柊婧愪唬鐮佺殑鏃跺欓兘蹇呴』闈炲父璋ㄦ厧銆備粬浠細鎵嬪姩鍚屾榪欎簺鏇存敼錛岀劧鍚庢彁浜や粬浠殑宸ヤ綔銆傝繖鏍蜂竴鏉ワ紝鐗堟湰鎺у埗緋葷粺瀵逛簬榪欎簺閰嶇疆鏂囦歡鏉ヨ宸茬粡姣棤鐢ㄥ銆傚鏋滄浘緇忎嬌鐢ㄨ繃Spring MVC錛岄偅涔堟偍搴旇鐭ラ亾applicationContext.xml鏄簲鐢ㄧ▼搴忎腑鐨勫叧閿粍浠訛紝鍥犱負鏄畠灝嗘墍鏈夌殑涓滆タ綺樺悎鍦ㄤ竴璧楓傛墍浠ワ紝鎴戜滑闇瑕佷竴縐嶆満鍒舵潵甯姪浣垮簲鐢ㄧ▼搴忎腑鍚勯」淇濇寔鏈夊簭錛岃繖鐐歸潪甯擱噸瑕併?/p><p>銆銆姝e鍓嶉潰鎵鎻愬埌鐨勶紝榪欐槸鎮ㄥ彲鑳介亣鍒扮殑杈冪畝鍗曠殑閰嶇疆闂銆傛洿闅劇殑闂鍑虹幇鍦ㄥ綋闇瑕佸湪涓嶅悓鏈嶅姟鍣ㄤ腑榪涜涓嶅悓鐨凚ean榪炴帴鐨勬椂鍊欍傝繖綾婚棶棰樺父浼氬嚭鐜板湪鏃ュ父杞歡寮鍙戜換鍔′腑銆備緥濡傦紝鍋囧鎮ㄧ殑浜у搧鏈変竴涓鎴瘋韓浠介獙璇佹ā鍧楋紝鍙互瀵規潵鑷叧緋繪暟鎹簱鎴朙DAP鏈嶅姟鍣ㄤ腑鐨勭敤鎴瘋繘琛岃韓浠介獙璇併傝嚜鐒訛紝榪欎竴韜喚楠岃瘉妯″潡鍙互浣跨敤鎶借薄浜嗙壒瀹氱増鏈簱鐨凚ean榪涜閰嶇疆銆傚鏋滄偍鎯蟲敼鍙樹笉鍚屽簲鐢ㄧ▼搴忛儴緗蹭腑楠岃瘉鐢ㄦ埛鐨勬柟寮忥紝灝遍渶瑕佸湪applicationContext.xml鏂囦歡涓繘琛屼笉鍚岀殑Bean榪炴帴銆傝繖縐嶉厤緗棶棰樺父瑙佷簬鍦ㄩ儴緗蹭腑鏈夊彲閰嶇疆鐗規х殑鎵鏈夊簲鐢ㄧ▼搴忋?/p><p>銆銆鍦ㄤ笅鏂囦腑錛屾垜浠皢璁ㄨ榪欎袱縐嶉厤緗棶棰樸傞鍏堟垜浠細鍏蟲敞鍚屾鐨凚ean灞炴ч棶棰樺強鍏惰В鍐蟲柟妗堬紝鎺ヤ笅鏉ワ紝鎴戜滑浼氳璁烘洿鍔犲鏉傜殑鍚屾Bean榪炴帴闂銆?/p><h1>瑙e喅鏂規</h1><h3>鍚屾Bean灞炴?/h3><p>銆銆榪欎釜闂鐨勪竴縐嶅彲琛岀殑瑙e喅鏂規鏄皢鎵鏈夌壒瀹氫簬涓繪満鐨勫弬鏁伴兘鏀懼埌鏅氱殑Java灞炴ф枃浠朵腑錛屼嬌鐢⊿pring鐨凱ropertyPlaceHolderConfigurer綾伙紝灝嗚繖浜涘弬鏁板啓鍏ean灞炴т腑銆?/p><p>銆銆浣跨敤榪欎竴瑙e喅鏂規錛屾垜浠彲浠ョ敓鎴愬涓嬬殑灞炴ф枃浠訛紙/WEB-INF/jdbc.properties錛夛細</p><pre class="code">聽<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">jdbc.driver=org.postgresql.Driver<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />jdbc.url=jdbc:postgresql://localhost/test<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />jdbc.user=postgres<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />jdbc.password=<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div></pre><p>銆銆鎴戜滑鐨凚ean閰嶇疆濡備笅錛?/p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">bean聽</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="propertyConfigurer"</span><span style="COLOR: #ff0000">聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽class</span><span style="COLOR: #0000ff">="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property聽</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="location"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">/WEB-INF/jdbc.properties</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">bean</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">bean聽</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="dataSource"</span><span style="COLOR: #ff0000">聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽class</span><span style="COLOR: #0000ff">="org.springframework.jdbc.datasource.DriverManagerDataSource"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property聽</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="driverClassName"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">${jdbc.driver}</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property聽</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="url"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">${jdbc.url}</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property聽</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="username"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">${jdbc.user}</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property聽</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="password"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">${jdbc.password}</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">bean</span><span style="COLOR: #0000ff">></span></div></pre><p>銆銆濡備笂鎵榪幫紝鎴戜滑瀹氫箟浜嗕竴涓狿ropertyPlaceholderConfigurer綾葷殑瀹炰緥錛屽茍灝嗗叾浣嶇疆灞炴ц緗負鎴戜滑鐨勫睘鎬ф枃浠躲傝綾昏瀹炵幇涓築ean宸ュ巶鐨勫悗澶勭悊鍣紝騫跺皢浣跨敤瀹氫箟鍦ㄦ枃浠朵腑鐨勫睘鎬ф潵浠f浛鎵鏈夌殑鍗犱綅絎︼紙${...}value錛夈?/p><p>銆銆鍒╃敤榪欑鎶鏈紝鎴戜滑鍙互浠巃pplicationContext.xml涓Щ闄ゆ墍鏈夌壒瀹氫簬涓繪満鐨勯厤緗睘鎬с傞氳繃榪欑鏂瑰紡錛屾垜浠彲浠ヨ嚜鐢卞湴涓鴻鏂囦歡娣誨姞鏂扮殑Bean錛岃屼笉蹇呮媴蹇冪壒瀹氫簬涓繪満灞炴х殑鍚屾鎬с傝繖鏍峰彲浠ョ畝鍖栫敓浜ч儴緗插拰緇存姢銆?/p><h3>鍚屾鎬ц繛鎺?/h3><p>銆銆涓婇潰鐨勬妧鏈В鍐充簡絎竴涓棶棰橈紝鍙槸濡傛灉鎮ㄨ鍒掍慨鏀逛笉鍚屽簲鐢ㄧ▼搴忛儴緗蹭箣闂寸殑Bean榪炴帴錛岃繖涓鎶鏈究涓嶅緢閫傚悎銆傞拡瀵硅繖涓闂鐨勪竴涓В鍐蟲柟妗堜究鏄澶栧垱寤轟竴涓悕涓篴pplicationContext-<strong>[hostname]</strong>.xml 鐨刋ML瀹氫箟鏂囦歡銆傚叾涓?strong>[hostname]</strong>鏄儴緗插簲鐢ㄧ▼搴忕殑涓繪満鐨勫悕縐般備緥濡傦紝鍦ㄦ湰鍦扮殑鏈哄櫒涓婏紝榪欎釜鏂囦歡閫氬父鍚嶄負applicationContext-<strong>localhost</strong>.xml錛岃屽湪閮ㄧ講鏃訛紝瀹冨彲鑳芥洿鍚嶄負applicationContext-<strong>somehost.com</strong>.xml銆?/p><p>銆銆鍙互鐚滄祴錛岃繖涓鏂囦歡蹇呴』鍖呮嫭鐗瑰畾浜庢煇涓涓繪満鐨勬墍鏈夐厤緗瓸ean銆傚湪鏈枃涓紝鎴戜滑灝嗗亣璁綿ataSource bean瀹氫箟灝嗕綅浜庤繖綾繪枃浠朵腑錛岃屼笉鏄氱敤鐨刟pplicationContext.xml瀹氫箟銆傚綋鐒訛紝榪欑鏈哄埗涓庡墠鑰呭茍闈炲啿紿侊紝浣嗘槸涓轟簡鏇村姞綆鍗曟槑浜嗭紝鎴戜滑灝嗗彧鍏蟲敞榪欑鏂規硶銆?/p><p>銆銆鏃㈢劧鎴戜滑宸茬粡鏈変簡鐗瑰畾鐨勯厤緗紝涓嬮潰鎴戜滑灝辨潵璁ㄨ涓涓嬪浣曞皢鍏舵暣鍚堝埌鏁翠釜Spring MVC閰嶇疆姒傚康涓傝杈懼埌榪欎竴鐩殑錛屽彲浠ユ湁璁稿鏂規硶錛屾垜浠皢璇︾粏鍦頒竴涓璇存槑銆備絾棣栧厛錛屾垜浠簲璇ユ敞鎰忓埌錛岀敱浜庢湁浜汢ean鍙兘浣嶄簬鐙珛鐨勯厤緗枃浠朵腑錛屽洜姝ゅ湪applicationContext.xml涓紝鎵鏈夊瀹冧滑鐨勫眬閮ㄥ紩鐢ㄩ兘蹇呴』鏇存崲鎴愬叏灞鍚嶇О銆?/p><p>銆銆渚嬪錛屽涓嬪紩鐢細</p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property聽</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="someProperty"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">ref聽</span><span style="COLOR: #ff0000">local</span><span style="COLOR: #0000ff">="someBean"</span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span></div></pre><p>銆銆搴旀洿鏀逛負錛?/p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property聽</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="someProperty"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">ref聽</span><span style="COLOR: #ff0000">bean</span><span style="COLOR: #0000ff">="someBean"</span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span></div></pre><p>銆銆鍦ㄨ繖涔嬪悗錛屾垜浠湁寰堝鍙互娣誨姞棰濆鐨勮祫婧愪互鐢ㄤ簬閰嶇疆鐨勬柟寮忋傚叾涓渶鏄庢樉鐨勫氨鏄嬌鐢?lt;import>鏍囩灝嗚繖涓棰濆璧勬簮鍖呭惈鍦╝pplicationContext.xml閰嶇疆鏂囦歡涓備嬌鐢ㄦ椂錛岃灝嗚鏍囩鏀懼湪applicationContext.xml鏂囦歡寮澶淬備緥濡傦細</p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">import聽</span><span style="COLOR: #ff0000">resource</span><span style="COLOR: #0000ff">="applicationContext-somehost.com.xml"</span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000">聽</span></div></pre><p>銆銆鐜板湪錛屽湪鐙珛鐨刋ML瀹氫箟鏂囦歡鍜屾櫘閫氱殑搴旂敤紼嬪簭涓婁笅鏂囧畾涔夋枃浠朵腑鐨勬墍鏈夐氱敤Bean瀹氫箟閮芥湁浜嗙壒瀹氫簬涓繪満鐨勮繛鎺ャ傜敱浜庡ぇ澶氭暟鐨凚ean閮戒笉鏄壒瀹氫簬涓繪満鐨勶紝鍥犳鎴戜滑鍙互鍍忓鐞哤eb搴旂敤紼嬪簭涓殑鍏朵粬璧勬簮涓鏍瘋嚜鐢卞湴澶勭悊applicationContext.xml鏂囦歡錛屽茍鍙互閫氳繃鍚堥傜殑鐗堟湰鎺у埗緋葷粺涓庡叾榪涜鍚屾銆?/p><p>銆銆浣嗘槸錛屼笂榪版柟娉曚篃鏈変竴瀹氱殑寮婄銆傚鏋滄偍鎯充繚鐣欎笉鍚孹ML鏂囦歡鐨勪笉鍚岄厤緗紝灝變粛鐒跺繀欏繪媴蹇僡pplicationContext.xml鐨勫悓姝ユэ紝鍥犱負璧勬簮鐨勫悕縐板繀欏繪牴鎹笉鍚屾湇鍔″櫒榪涜鏇存敼銆傝櫧鐒朵笌鍘熸湁鐨勮В鍐蟲柟妗堢浉姣旀湁浜嗗緢澶ф彁楂橈紝鍙渶鏇存敼鏂囦歡鍚嶏紝浣嗘槸榪欒繕鏄渶瑕佸紑鍙戜漢鍛樼殑鎵嬪姩鍗忓姪銆?/p><p>銆銆鐢變簬涓巃pplicationContext.xml鐩告瘮錛屼富鏈洪厤緗笉闇濡傛棰戠箒鍦拌繘琛屾洿鏀癸紝鍥犳涓嬩竴姝ヤ究鏄皢涓繪満閰嶇疆縐誨姩鍒皐eb.xml鏂囦歡涓紙濡傛灉鍙兘鐨勮瘽錛夈傚垢榪愮殑鏄紝鎴戜滑鏈変竴涓彲鐢ㄧ殑瑙e喅鏂規銆傜湅涓涓嬩笅闈㈠叧浜巜eb.xml閰嶇疆鐨勭墖鏂細</p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽 <span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">listener</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">listener-class</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽org.springframework.web.context.ContextLoaderListener<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">listener-class</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">listener</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">contextConfigLocation</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽/WEB-INF/applicationContext.xml聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽/WEB-INF/applicationContext-somehost.com.xml<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span></div></pre><p>銆銆姝e鎮ㄦ墍鐪嬪埌鐨勶紝闄や簡web.xml鏂囦歡涓父鏈夌殑ContextLoaderListener涔嬪錛屾垜浠繕娣誨姞浜哻ontextConfigLocation涓婁笅鏂囧弬鏁伴厤緗傝繖涓鍙傛暟鐢ㄤ簬鎸囩ず妗嗘灦鏌ユ壘榪欎簺閰嶇疆鏂囦歡鐨勪綅緗傚鏋滆繖涓鍙傛暟琚渷鐣ワ紝鍒橲pring灝卞彧鑳藉埌applicationContext.xml涓煡鎵俱傝繖閲屾垜浠篃瀹氫箟浜嗙壒瀹氫簬涓繪満鐨勯厤緗枃浠舵潵浣跨敤銆?/p><p>銆銆鍒╃敤榪欑鏂規硶錛屾垜浠皢鎵鏈夌壒瀹氫簬涓繪満鐨勯厤緗粠applicationContext.xml鏂囦歡涓Щ闄わ紝榪欐牱渚垮噺杞諱簡鍏跺湪涓嶅悓搴旂敤紼嬪簭閮ㄧ講涓殑鍚屾鎬с?/p><p>銆銆濡傛灉榪欑鏂規硶鎴愪負鎮ㄧ殑鏂頒範鎯紝鎮ㄨ繕鍙互浣垮叾鏇村姞鐏墊椿銆傞氳繃閬靛畧涓嬪垪鎸囦護錛屼篃鍙互灝嗙壒瀹氫簬涓繪満鐨勯厤緗粠web.xml鏂囦歡涓Щ闄ゃ?/p><p>銆銆涓烘錛岄渶瑕佸垱寤虹壒瀹氫簬鎴戜滑鐨勫簲鐢ㄧ▼搴忎笂涓嬫枃鐨勭被錛?/p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff">package</span><span style="COLOR: #000000">聽net.nighttale.spring.util;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">聽java.net.InetAddress;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">聽org.springframework.web.context.support.XmlWebApplicationContext;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽PerHostXmlWebApplicationContext聽<br /><img id="Codehighlighter1_220_1274_Open_Image" onclick="this.style.display='none'; Codehighlighter1_220_1274_Open_Text.style.display='none'; Codehighlighter1_220_1274_Closed_Image.style.display='inline'; Codehighlighter1_220_1274_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_220_1274_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_220_1274_Closed_Text.style.display='none'; Codehighlighter1_220_1274_Open_Image.style.display='inline'; Codehighlighter1_220_1274_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />聽</span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000">聽XmlWebApplicationContext聽</span><span id="Codehighlighter1_220_1274_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_220_1274_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽<br /><img id="Codehighlighter1_282_1272_Open_Image" onclick="this.style.display='none'; Codehighlighter1_282_1272_Open_Text.style.display='none'; Codehighlighter1_282_1272_Closed_Image.style.display='inline'; Codehighlighter1_282_1272_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_282_1272_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_282_1272_Closed_Text.style.display='none'; Codehighlighter1_282_1272_Open_Image.style.display='inline'; Codehighlighter1_282_1272_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">聽String[]聽getDefaultConfigLocations()聽</span><span id="Codehighlighter1_282_1272_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_282_1272_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽String聽hostname聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">localhost</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img id="Codehighlighter1_343_426_Open_Image" onclick="this.style.display='none'; Codehighlighter1_343_426_Open_Text.style.display='none'; Codehighlighter1_343_426_Closed_Image.style.display='inline'; Codehighlighter1_343_426_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_343_426_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_343_426_Closed_Text.style.display='none'; Codehighlighter1_343_426_Open_Image.style.display='inline'; Codehighlighter1_343_426_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">try</span><span style="COLOR: #000000">聽</span><span id="Codehighlighter1_343_426_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_343_426_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽hostname聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽InetAddress.getLocalHost().getHostName();<br /><img id="Codehighlighter1_448_462_Open_Image" onclick="this.style.display='none'; Codehighlighter1_448_462_Open_Text.style.display='none'; Codehighlighter1_448_462_Closed_Image.style.display='inline'; Codehighlighter1_448_462_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_448_462_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_448_462_Closed_Text.style.display='none'; Codehighlighter1_448_462_Open_Image.style.display='inline'; Codehighlighter1_448_462_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽}</span></span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">catch</span><span style="COLOR: #000000">聽(Exception聽e)聽</span><span id="Codehighlighter1_448_462_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_448_462_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽}</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽String聽perHostConfiguration聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽DEFAULT_CONFIG_LOCATION_PREFIX聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">applicationContext-</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽hostname聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽DEFAULT_CONFIG_LOCATION_SUFFIX<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽logger.debug(<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Adding聽per聽host聽configuration聽file:聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽perHostConfiguration<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽<br /><img id="Codehighlighter1_892_1115_Open_Image" onclick="this.style.display='none'; Codehighlighter1_892_1115_Open_Text.style.display='none'; Codehighlighter1_892_1115_Closed_Image.style.display='inline'; Codehighlighter1_892_1115_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_892_1115_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_892_1115_Closed_Text.style.display='none'; Codehighlighter1_892_1115_Open_Image.style.display='inline'; Codehighlighter1_892_1115_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">聽(getNamespace()聽</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">)聽</span><span id="Codehighlighter1_892_1115_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_892_1115_Open_Text"><span style="COLOR: #000000">{<br /><img id="Codehighlighter1_934_1100_Open_Image" onclick="this.style.display='none'; Codehighlighter1_934_1100_Open_Text.style.display='none'; Codehighlighter1_934_1100_Closed_Image.style.display='inline'; Codehighlighter1_934_1100_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_934_1100_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_934_1100_Closed_Text.style.display='none'; Codehighlighter1_934_1100_Open_Image.style.display='inline'; Codehighlighter1_934_1100_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽String[]聽</span><span id="Codehighlighter1_934_1100_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_934_1100_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽DEFAULT_CONFIG_LOCATION_PREFIX聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽getNamespace()聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽DEFAULT_CONFIG_LOCATION_SUFFIX<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽,聽perHostConfiguration}</span></span><span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽}</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_1134_1266_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1134_1266_Open_Text.style.display='none'; Codehighlighter1_1134_1266_Closed_Image.style.display='inline'; Codehighlighter1_1134_1266_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1134_1266_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1134_1266_Closed_Text.style.display='none'; Codehighlighter1_1134_1266_Open_Image.style.display='inline'; Codehighlighter1_1134_1266_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">聽</span><span id="Codehighlighter1_1134_1266_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_1134_1266_Open_Text"><span style="COLOR: #000000">{<br /><img id="Codehighlighter1_1176_1251_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1176_1251_Open_Text.style.display='none'; Codehighlighter1_1176_1251_Closed_Image.style.display='inline'; Codehighlighter1_1176_1251_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1176_1251_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1176_1251_Closed_Text.style.display='none'; Codehighlighter1_1176_1251_Open_Image.style.display='inline'; Codehighlighter1_1176_1251_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽String[]聽</span><span id="Codehighlighter1_1176_1251_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_1176_1251_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽DEFAULT_CONFIG_LOCATION<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽,聽perHostConfiguration}</span></span><span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽}</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div></pre><p>銆銆榪欎釜綾繪嫇灞曚簡Spring涓父琚綔涓洪粯璁ゅ間嬌鐢ㄧ殑XmlWebApplicationContext銆俋mlWebApplicationContext綾誨皢Web搴旂敤紼嬪簭鐨勯厤緗粠XML瀹氫箟鏂囦歡涓鍒惰繃鏉ャ傞粯璁ゆ儏鍐典笅錛屽畠鍙互閰嶇疆鏉ヨ嚜applicationContext.xml鍜?strong>[servlet-name]</strong>-servlet.xml鏂囦歡涓殑搴旂敤紼嬪簭銆傝繖涓被鎵ц鐨勬儫涓涓欏歸澶栦換鍔′究鏄幏鍙栧畠鎵鍦ㄧ殑涓繪満鍚嶇О錛屽茍灝哸pplicationContext-<strong>[hostname]</strong>.xml鏂囦歡娣誨姞鍒伴厤緗枃浠跺垪琛ㄤ腑銆?/p><p>銆銆涓轟簡浣跨敤榪欎釜綾伙紝鎴戜滑闇瑕佸鍏惰繘琛岀紪璇戯紝灝嗗叾鍖呭惈鍦ㄧ被閫斿緞涓紝騫舵寚紺篠pring妗嗘灦浣跨敤瀹冦傚墠涓ゆ闈炲父綆鍗曪紝鎴戜滑灝變笉鍦ㄦ璧樿堪銆傛垜浠彲浠ユ寚紺篠ping閫氳繃contextClass涓婁笅鏂囧弬鏁版潵浣跨敤瀹冦傞櫎浜唚eb.xml鏂囦歡涓殑鍘熸湁閰嶇疆錛屾垜浠繕鍙互娣誨姞涓嬪垪鍐呭錛?/p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">contextClass</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽net.nighttale.spring.util.PerHostXmlWebApplicationContext<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span></div></pre><p>銆銆濡傛灉鎴戜滑浣跨敤榪欎竴閰嶇疆鐗囨柇錛屽皢浼氭湁涓変釜鏂囦歡琚敤浜庡垵濮嬪寲榪欎釜妗嗘灦錛?strong>[servlet-name]</strong>-servlet.xml銆乤pplicationContext-<strong>[hostname]</strong>.xml浠ュ強applicationContext.xml銆?/p><p>銆銆姝e鎮ㄦ墍鐪嬪埌鐨勶紝applicationContext.xml鍜寃eb.xml鏂囦歡宸茬粡瀹屽叏鎽嗚劚浜嗕換浣曠壒瀹氱殑閰嶇疆緇嗚妭錛岃屼笖鎮ㄤ篃涓嶅繀鎷呭績浼氬湪鏇存柊搴旂敤紼嬪簭鏃剁牬鍧忛厤緗?/p><p>銆銆浣嗘槸錛岃繖縐嶆柟娉曟湁涓涓笉瓚充箣澶勩傚洜涓猴紝涓嶈鏄惁浼氫嬌鐢紝閮介渶瑕佸湪搴旂敤紼嬪簭閮ㄧ講涓湁絎笁涓厤緗枃浠躲傚湪榪欑鎯呭喌涓嬶紝渚夸笉闇瑕佺壒瀹氫簬涓繪満鐨勯厤緗備緥濡傦細</p><pre class="code"><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff"><?</span><span style="COLOR: #ff00ff">xml聽version="1.0"聽encoding="UTF-8"</span><span style="COLOR: #0000ff">?></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"><!</span><span style="COLOR: #ff00ff">DOCTYPE聽beans聽PUBLIC聽"-//SPRING//DTD聽BEAN//EN"聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽"http://www.springframework.org/dtd/spring-beans.dtd"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">beans</span><span style="COLOR: #0000ff">></</span><span style="COLOR: #800000">beans</span><span style="COLOR: #0000ff">></span></div></pre><p>銆銆鏈鍚庯紝闇瑕佺煡閬撳簲鐢ㄧ▼搴忎笂涓嬫枃綾婚渶瑕佹煡鎵劇殑鐗瑰畾涓繪満鍚嶃傛鏌ヤ富鏈哄悕縐扮殑鏈綆鍗曠殑鏂規硶鏄湪鏈哄櫒涓婅繍琛屼笅鍒椾唬鐮侊細</p><pre class="code">System.out.println(InetAddress.getLocalHost().getHostName())</pre><p>銆銆鍙互灝嗗叾浣滀負Java浠g爜鎵ц錛屼篃鍙湪鍠滄浣跨敤鐨勮剼鏈璦錛堝BeanShell鎴朑roovy錛変腑浣滀負涓涓叿鏈塉ava椋庢牸璇硶鐨勮剼鏈墽琛屻傚湪鑾峰彇浜嗕富鏈虹殑鍚嶇О涔嬪悗錛屽簲璇ュ垱寤轟竴涓粯璁ょ殑/WEB-INF/applicationContext-<strong>[hostname]</strong>.xml絀烘枃浠跺す錛堝鎴戜滑涓婇潰鎵瀹氫箟鐨勶級錛岀劧鍚庝究鍙互寮濮嬩簡銆?/p><h3>緇撴潫璇?/h3><p>銆銆鍦ㄦ湰鏂囦腑錛屾垜浠彁渚涗簡涓緋誨垪鐨勯厤緗妧宸э紝璁╂偍鍦ㄤ嬌鐢⊿pring MVC妗嗘灦瀹屾垚鏃ュ父宸ヤ綔鐨勬椂鍊欐洿鍔犺交鏉俱傚鏋滄偍甯屾湜鐭ラ亾濡備綍緇存姢鍚勭Web搴旂敤紼嬪簭閮ㄧ講錛屽彲浠ヨ瘯鐫鎵懼嚭鏈閫傚悎鎮ㄧ殑寮鍙戣繃紼嬬殑瑙e喅鏂規銆傛偍鐨勭敓媧諱細鏇翠負杞繪澗銆?/p><h3>鍙傝冭祫鏂?/h3><ul><li><a target="_blank">Spring framework</a></li></ul><p><b>鍘熸枃鍑哄:</b><a target="_blank">http://www.onjava.com/pub/a/onjava/2006/03/22/advanced-spring-configuration.html</a></p><!--鏂囩珷鍏朵粬淇℃伅--><div id="5hz5j5p" class="dot001"><img height="1" alt="" src="http://dev2dev.bea.com.cn/images/_.gif" width="100%" /></div><table cellspacing="0" cellpadding="3" width="100%" border="0"><tbody><tr valign="bottom"><td colspan="2" height="20">聽<span id="d35z55b" class="h2b">浣滆呯畝浠?/span></td></tr><tr><td valign="top" align="middle" width="0"></td><td><a target="_blank">Dejan Bosanac</a> 鏄竴浣嶈蔣浠跺紑鍙戜漢鍛樸佹妧鏈【闂拰浣滆咃紝浠栦富瑕佸叧娉ㄤ笉鍚屾妧鏈殑鏁村悎鍜屽崗浣滐紝灝ゅ叾鏄笌Java鍜學eb鐩稿叧鐨勬妧鏈?/td></tr></tbody></table><img src ="http://www.tkk7.com/yesjoy/aggbug/107020.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/yesjoy/" target="_blank">鈽厃esjoy鈽?/a> 2007-03-28 16:57 <a href="http://www.tkk7.com/yesjoy/articles/107020.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浣跨敤 jodd:form taghttp://www.tkk7.com/yesjoy/articles/80411.html鈽厃esjoy鈽?/dc:creator>鈽厃esjoy鈽?/author>Fri, 10 Nov 2006 07:23:00 GMThttp://www.tkk7.com/yesjoy/articles/80411.htmlhttp://www.tkk7.com/yesjoy/comments/80411.htmlhttp://www.tkk7.com/yesjoy/articles/80411.html#Feedback0http://www.tkk7.com/yesjoy/comments/commentRss/80411.htmlhttp://www.tkk7.com/yesjoy/services/trackbacks/80411.html

鍦?/font> SpringSide 閲岀炕鍒頒竴涓ソ涓滆タ錛? jodd:form

"
Jodd Form鐨勪嬌鐢ㄦ瀬鍏剁畝鍗曪紝鍥犱負澶畝鍗曚簡錛屾墠浼氬悕涓嶈緇忎紶鑰岃鎴戜滑閫夌敤錛岃鎴戜滑緗旈【鍚勫ぇFramework鐨凢orm Tag錛?/font>

浠栧彧瑕佹妸<form>鐨勫ご灝句互<jodd:form bean= "mybean">鍖呬綇鍗沖彲錛屽氨浼氳嚜鍔ㄧ粦瀹歮ybean鐨勬墍鏈夊悓鍚嶅睘鎬у埌鏅歨tml鏍囪--input, selectbox, checkbox,radiobox.....鍦ㄨ繖浜沬nput妗嗛噷涓嶇敤鍐嶅啓浠諱綍浠g爜

鍙錛屽畠鐨勫ソ澶勪竴鏄妭綰︿唬鐮侊紝浜屾槸淇濈暀浜唄tml鐗堢殑form tag, 涓嶉渶瑕佺敤涓濂梩aglib鏉ヤ唬鏇?/strong>

鑰屼笖鏀寔鍐呭祵瀵硅薄鐨勭粦瀹氾紝濡俠ook.category.name銆?/font>

姣旈偅浜涢渶瑕佷嬌鐢ㄩ潪綰痟tml鏍囪鐨?lt;ww:input>錛岄愪釜緇戝畾input妗嗭紝select妗嗙殑Form Tag錛岃櫧鍑忎簡浜涜鐏墊椿鎬э紝浣嗗疄鍦ㄦ柟渚垮緱澶帀瀹熾?/font>

濡傛灉灞炴ф潵鑷簬request錛岃屼笉鏄煇涓猨ava bean錛屽啓<jodd:form bean= "request">

jodd閲囩敤鐨勬槸鏅氱殑bean鍙嶅皠錛岃皟鐢ㄦ墍鏈夊睘鎬х殑toString()鍑芥暟銆?/font>

娉ㄦ剰錛宩odd鍦╤tml tag涓嶅惈value="xxx"灞炴ф椂鎵嶄細鑷姩緇戝畾銆傚鏋滄煇涓猧nput妗嗕綘涓嶅笇鏈沯odd鑷姩緇戝畾錛屾垨鑰呴粯璁ょ殑toString()涓嶈兘婊¤凍瑕佹眰鏃訛紝鍙互鎵嬪伐涓鴻input妗嗗啓涓?value="xxxx"錛宩odd鐪嬪埌浣犲凡緇忓畾涔変簡灞炴у鹼紝灝變細鑷姩緇曞紑銆?br /> "

< form聽 name ="form1" 聽action ="action.do?method=save" /> "聽聽method="post">聽
聽聽聽聽聽聽
< jodd:form聽 bean ="form1" 聽scope ="request" >
聽聽聽聽聽聽
< table聽 class ="border" 聽width ="90%" 聽cellSpacing =0聽 cellPadding =2聽 align ="center" >
聽聽聽聽
< tr >
聽聽聽聽聽聽
< td聽 width ="160" 聽class ="left" > 濮撳悕 </ td >
聽聽聽聽聽聽
< td聽 colspan ="3" 聽class ="right" >
聽聽聽聽聽聽聽聽聽聽
< input聽 name ="name" 聽type ="text" 聽class ="text" 聽size ="40" >
聽聽聽聽聽聽聽聽聽聽
< label聽 class ="star" > * </ label >
聽聽聽聽聽聽
</ td >
聽聽聽聽
</ tr >
聽聽聽聽
< tr >
聽聽聽聽聽聽
< td聽 width ="160" 聽class ="left" > 鎬у埆 </ td >
聽聽聽聽聽聽
< td聽 width ="303" 聽class ="right" >
聽聽聽聽聽聽聽聽
< input聽 name ="sex" 聽type ="text" 聽class ="text" 聽size ="40" >
聽聽聽聽聽聽聽聽
< label聽 class ="star" > * </ label >
聽聽聽聽聽聽
</ td >
聽聽聽聽
</ tr > 聽聽
聽聽聽聽
</ table >
聽聽聽聽
</ jodd:form >
</ form >

紜疄濂界敤錛?/p>

]]>
浣跨敤jodd form綆鍖朣pringMVC涓瑿ontroller鐨勯厤緗?http://www.tkk7.com/yesjoy/articles/80409.html鈽厃esjoy鈽?/dc:creator>鈽厃esjoy鈽?/author>Fri, 10 Nov 2006 07:20:00 GMThttp://www.tkk7.com/yesjoy/articles/80409.htmlhttp://www.tkk7.com/yesjoy/comments/80409.htmlhttp://www.tkk7.com/yesjoy/articles/80409.html#Feedback0http://www.tkk7.com/yesjoy/comments/commentRss/80409.htmlhttp://www.tkk7.com/yesjoy/services/trackbacks/80409.html

Jodd 鏄竴涓紑婧愰」鐩紝 http://jodd.sourceforge.net 錛?/span> 鏈変竴涓ソ鐢ㄧ殑 jsp 鏍囩錛屽彲浠ュぇ澶х畝鍖栨湁琛ㄥ崟杈撳叆鐨?/span> controller 銆?/span>

浣跨敤 Jodd 鐨勪紭鐐癸細

<!--[if !supportLists]-->1.<!--[endif]-->綆鍖栧拰緇熶竴controller錛屾姏寮?/span>extends SimpleFormController錛岀粺涓浣跨敤implements Controller鐨勬柟寮忋?/span>

<!--[if !supportLists]-->2.<!--[endif]-->綆鍖?/span>JSP欏甸潰鐨?/span>bind,涓嶉渶瑕佷竴涓瓧孌典竴涓瓧孌電殑緇戝畾銆?/span>

<!--[if !supportLists]-->3.<!--[endif]-->瀵?/span>bean娌℃湁浠諱綍瑕佹眰錛屽彲浠ヤ嬌鐢ㄤ換鎰忕殑bean鍋氫負formBean.

浣跨敤鏂規硶綆浠嬶細

<!--[if !supportLists]-->錛戯紟<!--[endif]-->鎶?/span>jodd.jar鏀懼埌web-inf->lib涓嬶紝鍦?/span>web.xml閲屽0鍚嶆爣絳撅細

< taglib >

聽聽聽聽聽聽聽
< taglib-uri > jodd </ taglib-uri >

聽聽聽聽聽聽聽
< taglib-location > /WEB-INF/lib/jodd.jar </ taglib-location >

聽聽聽聽
</ taglib >

<!--[if !supportLists]-->錛掞紟<!--[endif]-->浠繪剰鐨勪竴涓?/span>javaBean鍋氫負FormBean

package 聽caike;聽

public class 聽User聽{

聽聽聽聽聽聽聽
private 聽String聽userName;聽

聽聽聽聽聽聽聽
private 聽String聽password;
聽聽聽聽聽

聽聽聽聽聽聽聽
public 聽String聽getPassword()聽{

聽聽聽聽聽聽聽聽聽聽聽聽聽聽
return 聽password;

聽聽聽聽聽聽聽}聽

聽聽聽聽聽聽聽
public void 聽setPassword(String聽pwd)聽{

聽聽聽聽聽聽聽聽聽聽聽聽聽聽
this .password聽 = 聽pwd;

聽聽聽聽聽聽聽}聽

聽聽聽聽聽聽聽
public 聽String聽getUserName()聽{

聽聽聽聽聽聽聽聽聽聽聽聽聽聽
return 聽userName;

聽聽聽聽聽聽聽}聽

聽聽聽聽聽聽聽
public void 聽setUserName(String聽username)聽{

聽聽聽聽聽聽聽聽聽聽聽聽聽聽
this .userName聽 = 聽username;

聽聽聽聽聽聽聽}


}

<!--[if !supportLists]-->錛擄紟<!--[endif]-->鍦?/span>JSP欏甸潰浣跨敤jodd tag:,姣斿瀵瑰簲鐢ㄦ埛鐧誨綍欏甸潰鐨?/span>

<% @page聽import = " caike.User " %>

<% @taglib聽uri = " jodd " 聽prefix = " jodd " %>



< jodd:form聽 beans ="user" 聽scopes ="session" >

< form聽 action ="my.htm" 聽method ="post" >


聽聽聽聽
< table聽 width ="300" 聽border ="0" 聽cellspacing ="0" 聽cellpadding ="0"

聽聽聽聽聽聽聽align
="center" 聽class ="white" >

聽聽聽聽聽聽聽
< tr >

聽聽聽聽聽聽聽聽聽聽聽
< td聽 height ="32" 聽align ="right" 聽width ="107" > 鐢ㄦ埛鍚嶏細 </ td >

聽聽聽聽聽聽聽
< td聽 height ="32" 聽width ="193" >< input聽 type ="text" 聽name ="userName"

聽聽聽聽聽聽聽聽聽聽聽聽聽聽class
="input" 聽size ="20" > </ td > 聽聽聽聽聽聽聽聽 聽

聽聽聽聽聽聽聽
</ tr >

聽聽聽聽聽聽聽
< tr >

聽聽聽聽聽聽聽聽聽聽聽
< td聽 height ="33" 聽align ="right" 聽width ="107" > 瀵嗙爜錛?/span> </ td >

聽聽聽聽聽聽聽聽聽聽聽
< td聽 height ="33" 聽width ="193" >< input聽 type ="password" 聽name ="password"

聽聽聽聽聽聽聽聽聽聽聽聽聽聽class
="input" 聽size ="21" ></ td >

聽聽聽聽聽聽聽
</ tr >
聽聽聽聽聽聽

聽聽聽聽聽聽聽聽
< tr >

聽聽聽聽聽聽聽聽聽聽聽
< td聽 height ="69" 聽align ="center" 聽colspan ="2" >

聽聽聽聽聽聽聽聽聽聽聽聽
< input聽 type ="submit" 聽name ="Submit" 聽value ="鐧誨綍" >

聽聽聽聽聽聽聽
</ tr >

聽聽聽聽
</ table >

</ form >

</ jodd:form >

<!--[if !supportLists]-->錛旓紟<!--[endif]-->Dispatch-servelt.xml涓controller鐨勯厤緗?/span>

<bean id="myController" class="caike.MyController">聽聽聽聽

聽聽聽 </bean>

聽聽聽 涓嶅啀闇瑕佽繖縐嶆柟寮忥細

聽聽聽 <!--

聽聽聽聽聽聽 <bean id="myController" class="caike.MyFormController">聽聽聽聽

聽聽聽聽聽聽 <property name="commandClass" value="caike" />聽聽聽聽聽聽

聽聽聽聽聽聽 <property name="formView" value="userForm" />聽聽聽

聽聽聽聽聽聽 </bean>

聽聽聽 -->

<!--[if !supportLists]-->錛曪紟<!--[endif]-->鍦?/span>controller涓彇鍑?/span>user

package 聽caike;聽

import 聽javax.servlet.http.HttpServletRequest;

import 聽javax.servlet.http.HttpServletResponse;聽

import 聽jodd.bean.BeanUtil;聽

import 聽org.springframework.web.servlet.ModelAndView;

import 聽org.springframework.web.servlet.mvc.Controller;



public class 聽MyController聽 implements 聽Controller聽{



聽聽聽聽聽聽聽
public 聽ModelAndView聽handleRequest(HttpServletRequest聽request,

聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽HttpServletResponse聽response)聽
throws 聽Exception聽{



聽聽聽聽聽聽聽聽聽聽聽聽聽聽User聽user聽
= new 聽User();

聽聽聽聽聽聽聽聽聽聽聽聽聽聽BeanUtil.load(user,聽request);

聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println(
" 鐢ㄦ埛鍚? " + 聽user.getUserName()聽 + " 聽瀵嗙爜: " + 聽user.getPassword());

聽聽聽聽聽聽聽聽聽聽聽聽聽聽
return null ;

聽聽聽聽聽聽聽}



}

闇瑕佹敞鎰忕殑鍦版柟錛?/span>

琛ㄥ崟涓搴旂殑鍚嶅瓧 name 鍜?/span> javaBean 閲屽搴旂殑灞炴у悕瑕佺浉鍚屻?/span>

<input type="text" name="userName"

聽聽聽聽聽聽聽聽聽聽聽聽聽 class="input" size="20">

public class User {

聽聽聽聽聽聽 private String userName;

.......

聽鍙傝冿細

http://www.tkk7.com/calvin/archive/2005/08/24/10914.html

鑺遍挶鐨勫勾鍗?/a> 銆銆銆綆鍖朣pring(4)--View灞?/a>



]]>
主站蜘蛛池模板: 亚洲美女在线国产| 在线观看亚洲av每日更新| 亚洲高清美女一区二区三区| 国产成人精品一区二区三区免费| 91精品国产免费久久国语麻豆| 亚洲国产AV无码专区亚洲AV| 国产成人AV免费观看| 亚洲国产精品VA在线看黑人| 久热免费在线视频| 亚洲日韩乱码中文无码蜜桃 | 亚洲毛片αv无线播放一区| 成人国产精品免费视频| 久久久久亚洲av无码尤物| 亚洲精品亚洲人成在线播放| 久久不见久久见中文字幕免费| 亚洲日韩精品国产3区| 国产无遮挡又黄又爽免费视频| 婷婷精品国产亚洲AV麻豆不片 | eeuss影院免费92242部| 亚洲av午夜福利精品一区 | 无码av免费一区二区三区| 亚洲精品成人久久| 日本高清免费网站| 久久亚洲国产成人影院| 国产zzjjzzjj视频全免费| 亚洲图片中文字幕| 国产精品无码一区二区三区免费| rh男男车车的车车免费网站| 久久久久亚洲AV成人无码| 久久久久久国产精品免费免费 | 免费人成再在线观看网站| 亚洲国产精华液网站w| 大地资源在线观看免费高清| 视频免费1区二区三区| 亚洲精品无码久久久| 中文字幕在线视频免费观看 | 噜噜噜亚洲色成人网站| 亚洲Av熟妇高潮30p| 免费无码又爽又刺激高潮的视频| 巨胸喷奶水www永久免费| 亚洲自国产拍揄拍|