锘??xml version="1.0" encoding="utf-8" standalone="yes"?>天堂亚洲免费视频,亚洲第一区二区快射影院,亚洲人片在线观看天堂无码http://m.tkk7.com/jnbzwm/category/46252.html鏁忔嵎鏄竴鏉″緢闀跨殑璺紝鎽哥儲鐫鍓嶈繘鐫zh-cnTue, 05 Apr 2011 11:53:18 GMTTue, 05 Apr 2011 11:53:18 GMT60Hessian鏋勫緩鍒嗗竷寮忕郴緇熷簲鐢╗緇璢http://m.tkk7.com/jnbzwm/archive/2010/10/17/335376.html鏉?鏄?/dc:creator>鏉?鏄?/author>Sun, 17 Oct 2010 14:10:00 GMThttp://m.tkk7.com/jnbzwm/archive/2010/10/17/335376.htmlhttp://m.tkk7.com/jnbzwm/comments/335376.htmlhttp://m.tkk7.com/jnbzwm/archive/2010/10/17/335376.html#Feedback0http://m.tkk7.com/jnbzwm/comments/commentRss/335376.htmlhttp://m.tkk7.com/jnbzwm/services/trackbacks/335376.html鏈枃涓哄師鍒涳紝嬈㈣繋杞澆錛岃漿杞借娉ㄦ槑鍑哄BlogJava銆?br />
鍦ㄤ笂涓綃?Hessian鏋勫緩鍒嗗竷寮忕郴緇熷簲鐢?/a> 鐨勫熀紜涓婏紝鎴戜滑瀵圭▼搴忚繘琛屾敼榪涖?br /> 鐜板湪鏈変互涓嬫瘮杈冪獊鍑虹殑闂錛?br /> a.濡傛灉hessian鏈嶅姟绔垜瑕佸仛鐨勪笟鍔″緢澶氾紝鎬庝箞鍔烇紵
鎴戣瀹氫箟寰堝涓帴鍙o紝鐒跺悗鍐嶅啓瀹炵幇綾伙紝鏈鐑︾殑鏄繕瑕侀厤緗畠銆?br /> 鎴戠殑璁炬兂鏄紝hessian鏈嶅姟鍙彁渚涗竴涓綊鍙o紝鍐嶆瀵瑰鐨勬帴鍙e疄鐜頒腑鍙嶅皠璋冪敤鍏蜂綋鐨勪笟鍔$被銆?/p>

b.瀹㈡埛绔湪璋冪敤鏃訛紝姣忔璋冪敤榪滅▼鎺ュ彛閮借鐢ㄤ互涓嬩唬鐮佸悧錛?/p>

String url = "http://localhost:8080/HessianService/remote/service";
HessianProxyFactory factory 
= new HessianProxyFactory();
ServiceRemote rmt 
= (ServiceRemote) factory.create(ServiceRemote.class, url);


鏄劇劧鏄笉闇瑕佺殑銆?br /> 鎴戜滑鍙互閫氳繃鍔犲叆緙撳瓨鐨勬柟寮忓鍏惰繘琛屾敼鑹紝鎴戜滑涔熷彲浠ラ氳繃Spring鍦ㄥ鎴風綆$悊瀹冦?/p>

涓銆佸畬鍠刪essian鏈嶅姟绔疄鐜幫細
1.棣栧厛淇敼ServiceRemote鎺ュ彛錛?/p>

package com.al;

import java.util.Map;

@SuppressWarnings(
"unchecked")
public interface ServiceRemote  {
    
public Map callService(String target, Map inputMap) throws Exception;
}

callService涓虹粺涓鍏ュ彛錛屽湪姝ゅ仛濡備笅綰﹀畾錛?br /> 1)target瀛楃涓蹭負瑕佽皟鐢ㄧ殑service鐨勫畬鏁寸被璺緞+瑕佽皟鐢ㄧ殑鏂規硶銆?br /> 2)service鐨勬柟娉曞潎鐢ㄤ互涓嬫柟娉曠鍚嶏細
public Map ***(Map inputMap);
鍏ュ弬涓篗ap錛岃繑鍥炲間篃涓篗ap錛屽熀鏈彲浠ユ弧瓚蟲墍鏈夋儏鍐典簡銆傦紙鑷沖皯鍏ュ弬涓篗ap錛屽緢閫傚悎璋冪敤iBatis鏉ュDB榪涜鎿嶄綔銆傦級

2.淇敼鎺ュ彛瀹炵幇綾籗ervice錛屾綾諱笉鍋氬叿浣撲笟鍔★紝鑰屾槸鍙嶅皠璋冪敤鍏蜂綋涓氬姟綾伙細

package com.al;

import java.lang.reflect.Method;
import java.util.Map;

import org.apache.commons.beanutils.MethodUtils;
import org.apache.commons.lang.StringUtils;

@SuppressWarnings(
"unchecked")
public class Service implements ServiceRemote {

    
public Map callService(String target, Map inputMap) throws Exception {
        String className 
= StringUtils.substringBeforeLast(target, ".");
        String methodName 
= StringUtils.substringAfterLast(target, ".");
        Class serviceClass 
= loadClass(className);
        Method method 
= getMethod(serviceClass, methodName, Map.class);
        
// 鎻愪緵璁塊棶鏁堢巼
        method.setAccessible(true);
 
// 璋冪敤鍏蜂綋涓氬姟綾?/span>
        return (Map) method.invoke(serviceClass.newInstance(), inputMap);
    }

    
    
private static <T> Class<T> loadClass(String className) throws ClassNotFoundException {
            
return (Class<T>) getClassLoader().loadClass(className);
    }

    
    
private static ClassLoader getClassLoader() {
        
return Thread.currentThread().getContextClassLoader();
    }

    
    
private static Method getMethod(Class<?> cls, String name, Class<?> parameterTypes) {
        
return MethodUtils.getAccessibleMethod(cls, name, parameterTypes);
    }

}

 

3.涓句釜渚嬪瓙錛屾湇鍔$鎻愪緵涓氬姟綾籇isplayUserService.java

package com.al.service;

import java.util.HashMap;
import java.util.Map;

@SuppressWarnings(
"unchecked")
public class DisplayUserService {
    
public static final String selectUsers = "com.al.service.DisplayUserService.selectUsers";
    
public static final String deleteUser = "com.al.service.DisplayUserService.deleteUser";
    
    
public Map selectUsers(Map inputMap) {
        Map ret 
= new HashMap();
        
// 鏁版嵁搴撴搷浣滃彇寰楃敤鎴峰垪琛?nbsp;鐪佺暐
        ret.put("User""User");
        
return ret;
    }

    
    
public Map deleteUser(Map inputMap) {
        
// 鏁版嵁搴撴搷浣滃彇寰楃敤鎴峰垪琛?nbsp;鐪佺暐
        return null;
    }

}


鎵鏈夊叾浠栭厤緗笉鍙橈紝璇峰弬鑰冧笂涓綃?
Hessian鏋勫緩鍒嗗竷寮忕郴緇熷簲鐢?/a> 銆?/p>


浜屻佸鎴風浠g爜鐨勪慨鏀癸細
1.鍔犲叆spring榪涜綆$悊錛?br /> application.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    
<bean id="serviceRemote" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
        
<property name="serviceUrl" value="http://localhost:8080/HessianService/remote/service" />
        
<property name="serviceInterface" value="com.al.ServiceRemote" />
    
</bean>
</beans>

 

2.瀹㈡埛绔涓嬭皟鐢ㄥ嵆鍙細

package com.ai.client;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.al.ServiceRemote;
import com.al.service.DisplayUserService;

public class ClientTest {
    
public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext cxt 
= new ClassPathXmlApplicationContext("application.xml");
        ServiceRemote rmt 
= (ServiceRemote)cxt.getBean("serviceRemote");
        System.out.println(rmt.callService(DisplayUserService.selectUsers, 
null));
    }

}


鍙﹀涓縐嶆柟娉曟槸鑷繁瀹炵幇緙撳瓨銆?br /> 涔熷氨鏄涓嬈¤皟鐢ㄨ繙紼嬩唬鐮佹椂鐢熸垚ServiceRemote瀵硅薄錛屽皢鍏朵繚瀛樺湪闈欐佺殑瀹瑰櫒(HashMap)涓紝
姣忔鍑嗗璋冪敤姝よ繙紼嬩唬鐮佹椂錛屽厛鍒ゆ柇瀹瑰櫒涓槸鍚︽湁ServiceRemote瀵硅薄錛屾湁鍒欑洿鎺ュ皢鍏跺彇鍑哄茍浣跨敤鍗沖彲錛岃娉ㄦ剰鐨勫氨鏄湪榪欎釜瀹瑰櫒涓婄殑鍚屾闂銆?br /> 鍏蜂綋瀹炵幇灝變笉鍋氫簡錛屽緢綆鍗曘?/p>

鍦ㄩ」鐩腑錛屽浜庡鎴風浠g爜鏉ヨ錛岃繕鏄湁璁稿宸ヤ綔瑕佸仛鐨勶細
1) 濡傛灉鎴戜滑瑕佽皟鐢ㄥ涓繙紼嬫湇鍔℃庝箞鍔烇紵
鎴戜滑瑕佹彁渚涗竴涓粺涓璋冪敤錛屽皢榪滅▼璋冪敤鐨勫姩浣滃皝瑁呰搗鏉ワ紝璁╀嬌鐢ㄧ殑浜轟笉鐭ラ亾鑷繁璋冪敤浜嗕笉鍚岀殑榪滅▼鏈嶅姟銆?br /> 鍙璋冪敤鏌愪釜鏂規硶銆佷紶鍏ュ弬鏁板嵆鍙?/p>

2) 濡備綍鏂逛究寮鍙戝憳璋冭瘯榪滅▼鐨勬湇鍔′唬鐮侊紵
鍦ㄥ仛鍒嗗竷寮忕郴緇熷紑鍙戠殑鏃跺欙紝濡傛灉姣忎慨鏀逛竴涓嬪簲鐢ㄥ眰鐨剆ervice錛屽氨瑕佸鍏惰繘琛屽彂甯冿紝鐒跺悗鍐嶅幓璋冪敤鐪嬫槸鍚﹀凡OK錛岄偅鏁堢巼浼氬緢浣庛?/p>

3) 濡備綍綆$悊澶氭柟璋冪敤鐨勮繙紼嬫湇鍔★紵

4) 濡備綍鎻愰珮榪滅▼璋冪敤鐨勬晥鐜囷紵
鏄惁鍙互閫氳繃瀵?瀵硅薄榪涜緙撳瓨銆佹柟娉曟槸鍚︿篃鍙互緙撳瓨錛熺敋鑷蟲槸瀵硅皟鐢ㄧ粨鏋滆繘琛岀紦瀛橈紵

5) 絳夌瓑..
榪欎簺鍦ㄥ叿浣撶殑欏圭洰涓兘鏄笉寰椾笉鑰冭檻鐨勯棶棰樸備互鍚庡啀鎱㈡參璁ㄨ鍚с?/p>

]]>
Hessian鏋勫緩鍒嗗竷寮忕郴緇熷簲鐢?/title><link>http://m.tkk7.com/jnbzwm/archive/2010/10/17/335371.html</link><dc:creator>鏉?鏄?/dc:creator><author>鏉?鏄?/author><pubDate>Sun, 17 Oct 2010 13:11:00 GMT</pubDate><guid>http://m.tkk7.com/jnbzwm/archive/2010/10/17/335371.html</guid><wfw:comment>http://m.tkk7.com/jnbzwm/comments/335371.html</wfw:comment><comments>http://m.tkk7.com/jnbzwm/archive/2010/10/17/335371.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jnbzwm/comments/commentRss/335371.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jnbzwm/services/trackbacks/335371.html</trackback:ping><description><![CDATA[鏈枃涓哄師鍒涳紝嬈㈣繋杞澆錛岃漿杞借娉ㄦ槑鍑哄<a title="BlogJava" href="http://m.tkk7.com/jnbzwm/">BlogJava</a>銆?br /> <br /> <p>Hessian鏄竴涓交閲忕駭鐨剅emoting onhttp宸ュ叿錛屼嬌鐢ㄧ畝鍗曠殑鏂規硶鎻愪緵浜哛MI鐨勫姛鑳? 鐩告瘮WebService錛孒essian鏇寸畝鍗曘佸揩鎹楓?br /> 閲囩敤鐨勬槸浜岃繘鍒禦PC鍗忚錛屽洜涓洪噰鐢ㄧ殑鏄簩榪涘埗鍗忚錛屾墍浠ュ畠寰堥傚悎浜庡彂閫佷簩榪涘埗鏁版嵁銆?/p> <p>鏈枃灝嗗垎涓轟互涓嬪嚑涓唴瀹癸細<br /> 涓銆佷竴涓畝鍗曠殑Hessian璋冪敤渚嬪瓙<br /> 浜屻丼pring+Hessian鐨勪緥瀛?br /> 涓夈佷嬌鎴戜滑鐨勮皟鐢ㄥ彉寰楅氱敤</p> <p>絎竴閮ㄥ垎錛氫竴涓畝鍗曠殑Hessian璋冪敤渚嬪瓙<br /> 寤虹珛web宸ョ▼HessianService銆?br /> 榪欓噷涓轟簡綆鍗曡搗瑙侊紝鎴戝皢榪滅▼鎺ュ彛綾匯佹帴鍙e疄鐜扮被閮藉畾涔夊湪姝eb宸ョ▼涓嬨?/p> <p>涓漢瑙夊緱涓涓瘮杈冨ソ鐨勫仛娉曟槸灝唚eb宸ョ▼鍒嗗紑錛屾web宸ョ▼鍙畾涔夊澶栫殑鎺ュ彛騫舵彁渚涙湇鍔★紝鑰屽疄鐜扮被鏂板緩涓涓狫ava宸ョ▼瀛樻斁銆?br /> 榪欐牱web宸ョ▼渚濊禆姝ava宸ョ▼錛屼笖瀹㈡埛绔篃渚濊禆姝ava宸ョ▼銆?/p> <p>1) 榪滅▼鎺ュ彛綾?ServiceRemote.java</p> <p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> com.al;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.Map;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />@SuppressWarnings(</span><span style="color: #000000">"</span><span style="color: #000000">unchecked</span><span style="color: #000000">"</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_103_148_Open_Image" onclick="this.style.display='none'; Codehighlighter1_103_148_Open_Text.style.display='none'; Codehighlighter1_103_148_Closed_Image.style.display='inline'; Codehighlighter1_103_148_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_103_148_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_103_148_Closed_Text.style.display='none'; Codehighlighter1_103_148_Open_Image.style.display='inline'; Codehighlighter1_103_148_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">interface</span><span style="color: #000000"> ServiceRemote  </span><span id="Codehighlighter1_103_148_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_103_148_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> Map callService(Map inputMap) ;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <p><br /> 2) 瀹炵幇綾?Service.java</p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> com.al;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.HashMap;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.Map;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />@SuppressWarnings(</span><span style="color: #000000">"</span><span style="color: #000000">unchecked</span><span style="color: #000000">"</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_143_379_Open_Image" onclick="this.style.display='none'; Codehighlighter1_143_379_Open_Text.style.display='none'; Codehighlighter1_143_379_Closed_Image.style.display='inline'; Codehighlighter1_143_379_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_143_379_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_143_379_Closed_Text.style.display='none'; Codehighlighter1_143_379_Open_Image.style.display='inline'; Codehighlighter1_143_379_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Service </span><span style="color: #0000ff">implements</span><span style="color: #000000"> ServiceRemote </span><span id="Codehighlighter1_143_379_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_143_379_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img id="Codehighlighter1_187_377_Open_Image" onclick="this.style.display='none'; Codehighlighter1_187_377_Open_Text.style.display='none'; Codehighlighter1_187_377_Closed_Image.style.display='inline'; Codehighlighter1_187_377_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_187_377_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_187_377_Closed_Text.style.display='none'; Codehighlighter1_187_377_Open_Image.style.display='inline'; Codehighlighter1_187_377_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> Map callService(Map inputMap) </span><span id="Codehighlighter1_187_377_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_187_377_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_218_266_Open_Image" onclick="this.style.display='none'; Codehighlighter1_218_266_Open_Text.style.display='none'; Codehighlighter1_218_266_Closed_Image.style.display='inline'; Codehighlighter1_218_266_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_218_266_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_218_266_Closed_Text.style.display='none'; Codehighlighter1_218_266_Open_Image.style.display='inline'; Codehighlighter1_218_266_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(inputMap </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_218_266_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_218_266_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            inputMap </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HashMap();<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000"> do something<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000"> <img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        inputMap.put(</span><span style="color: #000000">"</span><span style="color: #000000">NAME</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">"</span><span style="color: #000000">Hessian</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> inputMap;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <p><br /> 3) web.xml閰嶇疆</p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000ff">?></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">web-app </span><span style="color: #ff0000">version</span><span style="color: #0000ff">="2.5"</span><span style="color: #ff0000"> xmlns</span><span style="color: #0000ff">="http://java.sun.com/xml/ns/javaee"</span><span style="color: #ff0000"> xmlns:xsi</span><span style="color: #0000ff">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #ff0000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xsi:schemaLocation</span><span style="color: #0000ff">="http://java.sun.com/xml/ns/javaee <br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">></span><span style="color: #000000">hessianService</span><span style="color: #0000ff"></</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet-class</span><span style="color: #0000ff">></span><span style="color: #000000">com.caucho.hessian.server.HessianServlet</span><span style="color: #0000ff"></</span><span style="color: #800000">servlet-class</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">init-param</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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">service-class</span><span style="color: #0000ff"></</span><span style="color: #800000">param-name</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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">com.al.Service</span><span style="color: #0000ff"></</span><span style="color: #800000">param-value</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">init-param</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">servlet</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet-mapping</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">></span><span style="color: #000000">hessianService</span><span style="color: #0000ff"></</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">url-pattern</span><span style="color: #0000ff">></span><span style="color: #000000">/hessianService</span><span style="color: #0000ff"></</span><span style="color: #800000">url-pattern</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">servlet-mapping</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">web-app</span><span style="color: #0000ff">></span></div> <p><br /> 緇忚繃浠ヤ笂3姝ワ紝hessian鏈嶅姟閮ㄧ講綆楁槸瀹屾垚浜嗭紝鍦╰omcat涓嬪彂甯冦?/p> <p>4) 璋冪敤鏂逛唬鐮?/p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> com.ai.client;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> com.al.ServiceRemote;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> com.caucho.hessian.client.HessianProxyFactory;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_132_480_Open_Image" onclick="this.style.display='none'; Codehighlighter1_132_480_Open_Text.style.display='none'; Codehighlighter1_132_480_Closed_Image.style.display='inline'; Codehighlighter1_132_480_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_132_480_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_132_480_Closed_Text.style.display='none'; Codehighlighter1_132_480_Open_Image.style.display='inline'; Codehighlighter1_132_480_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> ClientTest </span><span id="Codehighlighter1_132_480_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_132_480_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_194_478_Open_Image" onclick="this.style.display='none'; Codehighlighter1_194_478_Open_Text.style.display='none'; Codehighlighter1_194_478_Closed_Image.style.display='inline'; Codehighlighter1_194_478_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_194_478_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_194_478_Closed_Text.style.display='none'; Codehighlighter1_194_478_Open_Image.style.display='inline'; Codehighlighter1_194_478_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> Exception </span><span id="Codehighlighter1_194_478_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_194_478_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        String url </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">http://localhost:8080/HessianService/hessianService</span><span style="color: #000000">"</span><span style="color: #000000">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        HessianProxyFactory factory </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> HessianProxyFactory();<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        ServiceRemote rmt </span><span style="color: #000000">=</span><span style="color: #000000"> (ServiceRemote) factory.create(ServiceRemote.</span><span style="color: #0000ff">class</span><span style="color: #000000">, url);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(rmt.callService(</span><span style="color: #0000ff">null</span><span style="color: #000000">));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <p><br /> 鎵ц浠g爜錛岀粨鏋滃涓嬶細<br /> {NAME=Hessian}<br /> 璇存槑璋冪敤榪滅▼浠g爜鎴愬姛浜嗐?/p> <p>浜屻丼pring+Hessian鐨勪緥瀛?br /> 1) web宸ョ▼HessianService 鐨凷erviceRemote 鍜孲ervice綾諱笉鍙樸傚web.xml榪涜淇敼錛?br /> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000ff">?></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">web-app </span><span style="color: #ff0000">version</span><span style="color: #0000ff">="2.5"</span><span style="color: #ff0000"> xmlns</span><span style="color: #0000ff">="http://java.sun.com/xml/ns/javaee"</span><span style="color: #ff0000"> xmlns:xsi</span><span style="color: #0000ff">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #ff0000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xsi:schemaLocation</span><span style="color: #0000ff">="http://java.sun.com/xml/ns/javaee <br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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 alt="" src="http://m.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 alt="" src="http://m.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">/WEB-INF/dispatcher-servlet.xml</span><span style="color: #0000ff"></</span><span style="color: #800000">param-value</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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 alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">></span><span style="color: #000000">dispatcher</span><span style="color: #0000ff"></</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet-class</span><span style="color: #0000ff">></span><span style="color: #000000">org.springframework.web.servlet.DispatcherServlet</span><span style="color: #0000ff"></</span><span style="color: #800000">servlet-class</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">load-on-startup</span><span style="color: #0000ff">></span><span style="color: #000000">1</span><span style="color: #0000ff"></</span><span style="color: #800000">load-on-startup</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">servlet</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet-mapping</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">></span><span style="color: #000000">dispatcher</span><span style="color: #0000ff"></</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">url-pattern</span><span style="color: #0000ff">></span><span style="color: #000000">/remote/*</span><span style="color: #0000ff"></</span><span style="color: #800000">url-pattern</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">servlet-mapping</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">welcome-file-list</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">welcome-file</span><span style="color: #0000ff">></span><span style="color: #000000">index.jsp</span><span style="color: #0000ff"></</span><span style="color: #800000">welcome-file</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">welcome-file-list</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">web-app</span><span style="color: #0000ff">></span></div> <p><br /> 榪欓噷瑕佹敞鎰忕殑鏄?<br /> a)dispatcher-servlet.xml榪欎釜鏂囦歡鐨勫懡鍚嶃俿ervlet閰嶇疆涓篸ispatcher錛屽垯姝ゆ枃浠跺畾涔夎鍒欎負****-servlet.xml.<br /> <br /> b)鍙﹀灝辨槸Spring鍜宧essian鐨勭増鏈棶棰樸?br /> spring鐗堟湰鏄?.5.6錛岄渶瑕佸湪姝eb宸ョ▼涓嬪紩鍏ワ細spring-2.5.6.jar銆乻pring-webmvc-2.5.6.jar銆乧ommons-logging-1.1.1.jar銆?br /> hessian鐨勭増鏈槸hessian-3.1.6.jar錛宧essian鐨勪綆鐗堟湰濡?hessian-3.0.13鍜屾Spring鐗堟湰涓嶅悎銆傦紙鎴戣瘯楠屼簡鏄厤緗笉鎴愬姛鐨勩傦級</p> <p>2) dispatcher-servlet.xml<br /> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000ff">?></span><span style="color: #000000"><br /> <img alt="" src="http://m.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" "http://www.springframework.org/dtd/spring-beans.dtd"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">beans</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">description</span><span style="color: #0000ff">></span><span style="color: #000000">hessian server properties</span><span style="color: #0000ff"></</span><span style="color: #800000">description</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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">="serviceImpl"</span><span style="color: #ff0000"> class</span><span style="color: #0000ff">="com.al.Service"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">bean </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="/service"</span><span style="color: #ff0000"> class</span><span style="color: #0000ff">="org.springframework.remoting.caucho.HessianServiceExporter"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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">="service"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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">="serviceImpl"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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">="serviceInterface"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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">com.al.ServiceRemote</span><span style="color: #0000ff"></</span><span style="color: #800000">value</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">property</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">bean</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.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></div> <p><br /> 3) 瀹㈡埛绔唬鐮佸彲浠ヤ繚鎸佸師鏍蜂笉鍙橈紝鎶婅皟鐢╤essian鏈嶅姟鐨剈rl鍙樻崲涓涓嬪嵆鍙細<br /> http://localhost:8080/HessianService/remote/service<br /> http://IP:port/鍙戝竷宸ョ▼鍚?web.xml涓厤緗殑url-pattern/****-servlet.xml bean鐨処D銆?/p> <p>涓夈佷嬌鎴戜滑鐨勮皟鐢ㄥ彉寰楅氱敤 灝嗗湪涓嬩竴綃囦腑浠嬬粛銆?/p> <img src ="http://m.tkk7.com/jnbzwm/aggbug/335371.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jnbzwm/" target="_blank">鏉?鏄?/a> 2010-10-17 21:11 <a href="http://m.tkk7.com/jnbzwm/archive/2010/10/17/335371.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>閫氳繃Spring瀹炵幇瀵硅嚜瀹氫箟娉ㄨВ灞炴ц繘琛岃祫婧愭敞鍏?/title><link>http://m.tkk7.com/jnbzwm/archive/2010/10/04/333721.html</link><dc:creator>鏉?鏄?/dc:creator><author>鏉?鏄?/author><pubDate>Mon, 04 Oct 2010 02:31:00 GMT</pubDate><guid>http://m.tkk7.com/jnbzwm/archive/2010/10/04/333721.html</guid><wfw:comment>http://m.tkk7.com/jnbzwm/comments/333721.html</wfw:comment><comments>http://m.tkk7.com/jnbzwm/archive/2010/10/04/333721.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jnbzwm/comments/commentRss/333721.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jnbzwm/services/trackbacks/333721.html</trackback:ping><description><![CDATA[閫氳繃涓婁竴綃?<a id="viewpost1_TitleUrl" href="http://m.tkk7.com/jnbzwm/archive/2010/10/04/333720.html">鍒╃敤鑷畾涔塉ava娉ㄨВ瀹炵幇璧勬簮娉ㄥ叆</a> 浠嬬粛鐨勬柟娉曪紝鎴戜滑瀹炵幇浜嗛氳繃鑷畾涔夋敞瑙e畬鎴愪簡瀵笵ataSource璧勬簮鐨勬敞鍏ワ紝浣嗗湪瀹為檯搴旂敤涓紝鎴戜滑閫氬父涓嶅笇鏈涘幓鏄懼紡鐨勫幓澹版槑榪欐牱鐨凪yAnnotationBeanProcessor瀵硅薄鏉ュ府鍔╂垜浠畬鎴愭敞鍏ワ紝鑰屾槸甯屾湜閫氳繃Spring甯垜浠?#8220;鎮勬倓鍦?#8221;瀹屾垚銆?br /> 緇?<a id="viewpost1_TitleUrl" href="http://m.tkk7.com/jnbzwm/archive/2010/10/04/333720.html">鍒╃敤鑷畾涔塉ava娉ㄨВ瀹炵幇璧勬簮娉ㄥ叆</a> 閲岀殑浠g爜(閮ㄥ垎浠g爜)涓嶅彉錛屾垜浠笇鏈涘湪嫻嬭瘯綾諱腑浠ュ涓嬫柟娉曡皟鐢ㄤ究鍙互瀹炵幇璧勬簮鐨勬敞鍏ワ細<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">import</span><span style="color: #000000"> org.springframework.context.support.ClassPathXmlApplicationContext;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> com.annotation.MyService;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_140_541_Open_Image" onclick="this.style.display='none'; Codehighlighter1_140_541_Open_Text.style.display='none'; Codehighlighter1_140_541_Closed_Image.style.display='inline'; Codehighlighter1_140_541_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_140_541_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_140_541_Closed_Text.style.display='none'; Codehighlighter1_140_541_Open_Image.style.display='inline'; Codehighlighter1_140_541_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> SpringWiringTest </span><span id="Codehighlighter1_140_541_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_140_541_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_185_539_Open_Image" onclick="this.style.display='none'; Codehighlighter1_185_539_Open_Text.style.display='none'; Codehighlighter1_185_539_Closed_Image.style.display='inline'; Codehighlighter1_185_539_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_185_539_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_185_539_Closed_Text.style.display='none'; Codehighlighter1_185_539_Open_Image.style.display='inline'; Codehighlighter1_185_539_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String args[]) </span><span id="Codehighlighter1_185_539_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_185_539_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        ClassPathXmlApplicationContext ctx </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ClassPathXmlApplicationContext(</span><span style="color: #000000">"</span><span style="color: #000000">com/spring/applicationContext.xml</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        MyService b </span><span style="color: #000000">=</span><span style="color: #000000"> (MyService)ctx.getBean(</span><span style="color: #000000">"</span><span style="color: #000000">myService</span><span style="color: #000000">"</span><span style="color: #000000">); </span><span style="color: #008000">//</span><span style="color: #008000"> 閫氳繃Spring鍘葷鐞哹ean錛屾鏃跺凡瀹屾垚浜嗗鏍囨湁DataSource娉ㄨВ鐨勮祫婧愮殑娉ㄥ叆</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        System.out.println(b.selectForObjectFromB(</span><span style="color: #000000">""</span><span style="color: #000000">, </span><span style="color: #0000ff">null</span><span style="color: #000000">));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(b.selectForObjectFromA(</span><span style="color: #000000">""</span><span style="color: #000000">, </span><span style="color: #0000ff">null</span><span style="color: #000000">));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <br /> 娉細MyService綾誨疄鐜板湪 <a id="viewpost1_TitleUrl" href="http://m.tkk7.com/jnbzwm/archive/2010/10/04/333720.html">鍒╃敤鑷畾涔塉ava娉ㄨВ瀹炵幇璧勬簮娉ㄥ叆</a> 涓?br /> <br /> 涓轟簡瀹炵幇涓婇潰鐨勭洰鏍囷紝鎴戜滑灝變笉鑳戒嬌鐢∕yAnnotationBeanProcessor.java綾繪潵瀹炵幇瀵硅祫婧愮殑娉ㄥ叆浜嗭紝鎴戜滑蹇呴』瀹炵幇涓涓兘铻嶅叆Spring鐨凚eanProcessor綾繪墠琛屻?br /> DataSourceBeanProcessor.java綾誨疄鐜癇eanPostProcessor銆丳riorityOrdered鎺ュ彛錛?br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">import</span><span style="color: #000000"> java.lang.reflect.Field;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.springframework.beans.BeansException;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.springframework.beans.factory.config.BeanPostProcessor;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.springframework.core.Ordered;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> org.springframework.core.PriorityOrdered;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_323_980_Open_Image" onclick="this.style.display='none'; Codehighlighter1_323_980_Open_Text.style.display='none'; Codehighlighter1_323_980_Closed_Image.style.display='inline'; Codehighlighter1_323_980_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_323_980_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_323_980_Closed_Text.style.display='none'; Codehighlighter1_323_980_Open_Image.style.display='inline'; Codehighlighter1_323_980_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> DataSourceBeanProcessor </span><span style="color: #0000ff">implements</span><span style="color: #000000"> BeanPostProcessor, PriorityOrdered </span><span id="Codehighlighter1_323_980_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_323_980_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    @Override<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #008000">//</span><span style="color: #008000"> 鍦ㄨ繖閲屽畬鎴愯祫婧愭敞鍏?/span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">    </span><span style="color: #0000ff">public</span><span style="color: #000000"> Object postProcessAfterInitialization(Object bean, String beanName)<br /> <img id="Codehighlighter1_465_733_Open_Image" onclick="this.style.display='none'; Codehighlighter1_465_733_Open_Text.style.display='none'; Codehighlighter1_465_733_Closed_Image.style.display='inline'; Codehighlighter1_465_733_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_465_733_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_465_733_Closed_Text.style.display='none'; Codehighlighter1_465_733_Open_Image.style.display='inline'; Codehighlighter1_465_733_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">throws</span><span style="color: #000000"> BeansException </span><span id="Codehighlighter1_465_733_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_465_733_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        Class</span><span style="color: #000000"><?></span><span style="color: #000000"> cls </span><span style="color: #000000">=</span><span style="color: #000000"> bean.getClass();<br /> <img id="Codehighlighter1_559_706_Open_Image" onclick="this.style.display='none'; Codehighlighter1_559_706_Open_Text.style.display='none'; Codehighlighter1_559_706_Closed_Image.style.display='inline'; Codehighlighter1_559_706_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_559_706_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_559_706_Closed_Text.style.display='none'; Codehighlighter1_559_706_Open_Image.style.display='inline'; Codehighlighter1_559_706_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">for</span><span style="color: #000000"> (Field field : cls.getDeclaredFields()) </span><span id="Codehighlighter1_559_706_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_559_706_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_622_696_Open_Image" onclick="this.style.display='none'; Codehighlighter1_622_696_Open_Text.style.display='none'; Codehighlighter1_622_696_Closed_Image.style.display='inline'; Codehighlighter1_622_696_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_622_696_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_622_696_Closed_Text.style.display='none'; Codehighlighter1_622_696_Open_Image.style.display='inline'; Codehighlighter1_622_696_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (field.isAnnotationPresent(DataSource.</span><span style="color: #0000ff">class</span><span style="color: #000000">)) </span><span id="Codehighlighter1_622_696_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_622_696_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                DataSourceStaticWiring.wiring(bean, field);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> bean;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    @Override<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> Object postProcessBeforeInitialization(Object bean, String beanName)<br /> <img id="Codehighlighter1_860_887_Open_Image" onclick="this.style.display='none'; Codehighlighter1_860_887_Open_Text.style.display='none'; Codehighlighter1_860_887_Closed_Image.style.display='inline'; Codehighlighter1_860_887_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_860_887_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_860_887_Closed_Text.style.display='none'; Codehighlighter1_860_887_Open_Image.style.display='inline'; Codehighlighter1_860_887_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">throws</span><span style="color: #000000"> BeansException </span><span id="Codehighlighter1_860_887_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_860_887_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> bean;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    @Override<br /> <img id="Codehighlighter1_930_978_Open_Image" onclick="this.style.display='none'; Codehighlighter1_930_978_Open_Text.style.display='none'; Codehighlighter1_930_978_Closed_Image.style.display='inline'; Codehighlighter1_930_978_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_930_978_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_930_978_Closed_Text.style.display='none'; Codehighlighter1_930_978_Open_Image.style.display='inline'; Codehighlighter1_930_978_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> getOrder() </span><span id="Codehighlighter1_930_978_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_930_978_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> Ordered.LOWEST_PRECEDENCE;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <br /> 涓嬮潰鏉ョ湅DataSourceStaticWiring鐨勫疄鐜幫紝涓庡墠涓綃?閲岀殑DataSourceWiring.java綾葷浉姣旓紝鏀瑰姩鐐規湁浠ヤ笅涓変釜錛?br /> 1.涓嶉渶瑕佸疄鐜癐FieldWiring鎺ュ彛<br /> 2.鍒犻櫎annotationClass鏂規硶<br /> 3.灝唚iring鏂規硶淇敼涓簊tatic鏂規硶<br /> 鍏蜂綋浠g爜濡備笅錛?br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">import</span><span style="color: #000000"> java.lang.reflect.Field;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_69_642_Open_Image" onclick="this.style.display='none'; Codehighlighter1_69_642_Open_Text.style.display='none'; Codehighlighter1_69_642_Closed_Image.style.display='inline'; Codehighlighter1_69_642_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_69_642_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_69_642_Closed_Text.style.display='none'; Codehighlighter1_69_642_Open_Image.style.display='inline'; Codehighlighter1_69_642_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> DataSourceStaticWiring </span><span id="Codehighlighter1_69_642_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_69_642_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img id="Codehighlighter1_130_640_Open_Image" onclick="this.style.display='none'; Codehighlighter1_130_640_Open_Text.style.display='none'; Codehighlighter1_130_640_Closed_Image.style.display='inline'; Codehighlighter1_130_640_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_130_640_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_130_640_Closed_Text.style.display='none'; Codehighlighter1_130_640_Open_Image.style.display='inline'; Codehighlighter1_130_640_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> wiring(Object object, Field field) </span><span id="Codehighlighter1_130_640_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_130_640_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        Object fieldObj </span><span style="color: #000000">=</span><span style="color: #000000"> ReflectUtils.getFieldValue(object, field.getName());<br /> <img id="Codehighlighter1_241_271_Open_Image" onclick="this.style.display='none'; Codehighlighter1_241_271_Open_Text.style.display='none'; Codehighlighter1_241_271_Closed_Image.style.display='inline'; Codehighlighter1_241_271_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_241_271_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_241_271_Closed_Text.style.display='none'; Codehighlighter1_241_271_Open_Image.style.display='inline'; Codehighlighter1_241_271_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (fieldObj </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_241_271_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_241_271_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">return</span><span style="color: #000000">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        DataSource annotation </span><span style="color: #000000">=</span><span style="color: #000000"> field.getAnnotation(DataSource.</span><span style="color: #0000ff">class</span><span style="color: #000000">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        String type </span><span style="color: #000000">=</span><span style="color: #000000"> annotation.type();<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        String sqlMap </span><span style="color: #000000">=</span><span style="color: #000000"> annotation.sqlMap();<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000"> 榪欓噷鍙互鐢ㄧ紦瀛樻潵瀹炵幇錛屼笉鐢ㄦ瘡嬈¢兘鍘誨垱寤烘柊鐨凷qlMapClient瀵硅薄</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        SqlMapClient sqlMapImpl </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> SqlMapClient(sqlMap, type);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        ReflectUtils.setFieldValue(object, field.getName(), SqlMapClient.</span><span style="color: #0000ff">class</span><span style="color: #000000">, sqlMapImpl);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <br /> 娉細SqlMapClient銆丷eflectUtils瀹炵幇鍦ㄤ笂涓綃?<a id="viewpost1_TitleUrl" href="http://m.tkk7.com/jnbzwm/archive/2010/10/04/333720.html">鍒╃敤鑷畾涔塉ava娉ㄨВ瀹炵幇璧勬簮娉ㄥ叆</a> 涓?br /> <br /> 浠g爜宸插噯澶囧氨緇紝鎺ヤ笅鏉ユ槸閰嶇疆Spring錛歛pplicationContext.xml<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000ff">?></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">beans </span><span style="color: #ff0000">xmlns</span><span style="color: #0000ff">="http://www.springframework.org/schema/beans"</span><span style="color: #ff0000"> xmlns:xsi</span><span style="color: #0000ff">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #ff0000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xmlns:aop</span><span style="color: #0000ff">="http://www.springframework.org/schema/aop"</span><span style="color: #ff0000"> xmlns:tx</span><span style="color: #0000ff">="http://www.springframework.org/schema/tx"</span><span style="color: #ff0000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xmlns:context</span><span style="color: #0000ff">="http://www.springframework.org/schema/context"</span><span style="color: #ff0000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    xsi:schemaLocation</span><span style="color: #0000ff">="http://www.springframework.org/schema/beans <br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                        http://www.springframework.org/schema/aop <br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                        http://www.springframework.org/schema/aop/spring-aop-2.5.xsd<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                        http://www.springframework.org/schema/tx <br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                        http://www.springframework.org/schema/tx/spring-tx-2.5.xsd<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />                        http://www.springframework.org/schema/context<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />           http://www.springframework.org/schema/context/spring-context-2.5.xsd"</span><span style="color: #ff0000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    default-lazy-init</span><span style="color: #0000ff">="true"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    <br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #008000"><!--</span><span style="color: #008000"> 鑷畾涔夌殑BeanProcessor </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">bean </span><span style="color: #ff0000">class</span><span style="color: #0000ff">="com.annotation.DataSourceBeanProcessor"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">context:component-scan </span><span style="color: #ff0000">base-package</span><span style="color: #0000ff">="com.annotation"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #008000"><!--</span><span style="color: #008000"> 嫻嬭瘯鐢╞ean </span><span style="color: #008000">--></span><span style="color: #000000"><br /> <img alt="" src="http://m.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">="myService"</span><span style="color: #ff0000"> class</span><span style="color: #0000ff">="com.annotation.MyService"</span><span style="color: #ff0000"> destroy-method</span><span style="color: #0000ff">="close"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">bean</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">beans</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> <br /> 嫻嬭瘯浠g爜鍏跺疄宸茬粡鍦ㄥ墠闈㈠垪鍑烘潵浜嗐係pringWiringTest.java<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">import</span><span style="color: #000000"> org.springframework.context.support.ClassPathXmlApplicationContext;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> com.annotation.MyService;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_140_494_Open_Image" onclick="this.style.display='none'; Codehighlighter1_140_494_Open_Text.style.display='none'; Codehighlighter1_140_494_Closed_Image.style.display='inline'; Codehighlighter1_140_494_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_140_494_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_140_494_Closed_Text.style.display='none'; Codehighlighter1_140_494_Open_Image.style.display='inline'; Codehighlighter1_140_494_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> SpringWiringTest </span><span id="Codehighlighter1_140_494_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_140_494_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_185_492_Open_Image" onclick="this.style.display='none'; Codehighlighter1_185_492_Open_Text.style.display='none'; Codehighlighter1_185_492_Closed_Image.style.display='inline'; Codehighlighter1_185_492_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_185_492_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_185_492_Closed_Text.style.display='none'; Codehighlighter1_185_492_Open_Image.style.display='inline'; Codehighlighter1_185_492_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String args[]) </span><span id="Codehighlighter1_185_492_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_185_492_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        ClassPathXmlApplicationContext ctx </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ClassPathXmlApplicationContext(</span><span style="color: #000000">"</span><span style="color: #000000">com/spring/applicationContext.xml</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        MyService b </span><span style="color: #000000">=</span><span style="color: #000000"> (MyService)ctx.getBean(</span><span style="color: #000000">"</span><span style="color: #000000">myService</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(b.selectForObjectFromB(</span><span style="color: #000000">""</span><span style="color: #000000">, </span><span style="color: #0000ff">null</span><span style="color: #000000">));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(b.selectForObjectFromA(</span><span style="color: #000000">""</span><span style="color: #000000">, </span><span style="color: #0000ff">null</span><span style="color: #000000">));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <br /> 鎵ц緇撴灉錛?br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">SqlMapClient[sqlMap</span><span style="color: #000000">=</span><span style="color: #000000">com</span><span style="color: #000000">/</span><span style="color: #000000">annotation</span><span style="color: #000000">/</span><span style="color: #000000">sql</span><span style="color: #000000">-</span><span style="color: #000000">map</span><span style="color: #000000">-</span><span style="color: #000000">config</span><span style="color: #000000">-</span><span style="color: #000000">B.xml,type</span><span style="color: #000000">=</span><span style="color: #000000">B]<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />SqlMapClient[sqlMap</span><span style="color: #000000">=</span><span style="color: #000000">com</span><span style="color: #000000">/</span><span style="color: #000000">annotation</span><span style="color: #000000">/</span><span style="color: #000000">sql</span><span style="color: #000000">-</span><span style="color: #000000">map</span><span style="color: #000000">-</span><span style="color: #000000">config</span><span style="color: #000000">-</span><span style="color: #000000">A.xml,type</span><span style="color: #000000">=</span><span style="color: #000000">A]</span></div> <br /> 鐢辯粨鏋滃彲瑙侊紝鎴戜滑鍒╃敤Spring瀹屾垚浜嗗DataSource璧勬簮鐨勬敞鍏ヤ簡銆?br /> <br /> 鍦ㄨ繖閲屽鏋滆繕鎯蟲墿灞曠殑璇濓紝灝遍渶瑕佹柊寤虹被鍋囪涓篒nParamBeanProcessor錛屽疄鐜癇eanPostProcessor銆丳riorityOrdered鎺ュ彛錛岀劧鍚庡疄鐜板叾涓殑鏂規硶錛屽璧勬簮榪涜娉ㄥ叆錛岃繖閲屽氨鏄墿灞昐pring浜嗭紝涓庢湰綃囦粙緇嶇殑鏂規硶鐩稿悓銆?br /> <br /> <span style="color: red">娉細浠ヤ笂浠g爜閲嶅湪婕旂ず錛屽叾瀹炶繖涓渶姹傚彲浠ュ湪Spring涓鐞嗕袱涓笉鍚岀殑SqlMapClient瀵硅薄錛岀劧鍚庨氳繃Spring鐨勮嚜鍔ㄦ敞鍏ュ疄鐜般?br /> </span><br /> 鏈枃涓哄師鍒涳紝嬈㈣繋杞澆錛岃漿杞借娉ㄦ槑鍑哄<a title="BlogJava" href="http://m.tkk7.com/jnbzwm/">BlogJava</a>銆?br /> <img src ="http://m.tkk7.com/jnbzwm/aggbug/333721.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jnbzwm/" target="_blank">鏉?鏄?/a> 2010-10-04 10:31 <a href="http://m.tkk7.com/jnbzwm/archive/2010/10/04/333721.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎵╁睍Spring-瀹炵幇瀵瑰閮ㄥ紩鐢ㄧ殑灞炴ф枃浠惰繘琛屽姞瀵嗐佽В瀵?/title><link>http://m.tkk7.com/jnbzwm/archive/2010/10/02/333647.html</link><dc:creator>鏉?鏄?/dc:creator><author>鏉?鏄?/author><pubDate>Sat, 02 Oct 2010 04:44:00 GMT</pubDate><guid>http://m.tkk7.com/jnbzwm/archive/2010/10/02/333647.html</guid><wfw:comment>http://m.tkk7.com/jnbzwm/comments/333647.html</wfw:comment><comments>http://m.tkk7.com/jnbzwm/archive/2010/10/02/333647.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jnbzwm/comments/commentRss/333647.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jnbzwm/services/trackbacks/333647.html</trackback:ping><description><![CDATA[     鎽樿: 緇т笂涓綃?鎵╁睍Spring-瀹炵幇瀵瑰閮ㄥ紩鐢ㄧ殑灞炴ф枃浠剁殑 灞炴у?榪涜鍔犲瘑銆佽В瀵?nbsp;錛岃繖嬈¤瀹炵幇鐨勬槸瀵規暣涓閮ㄥ睘鎬ф枃浠惰繘琛屽姞瀵嗭紝Spring鍦ㄥ姞杞借繖涓閮ㄥ睘鎬ф枃浠舵椂榪涜瑙e瘑銆?鍒嗘瀽榪囩▼涓庡湪 鎵╁睍Spring-瀹炵幇瀵瑰閮ㄥ紩鐢ㄧ殑灞炴ф枃浠剁殑 灞炴у?榪涜鍔犲瘑銆佽В瀵?nbsp;涓粙緇嶇殑鍩烘湰涓鑷達紝鍙笉榪囪繖嬈$殑鍏ュ彛灝卞湪 PropertiesLoaderSupport.java 榪欎釜鎶借薄綾葷殑loadPr...  <a href='http://m.tkk7.com/jnbzwm/archive/2010/10/02/333647.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/jnbzwm/aggbug/333647.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jnbzwm/" target="_blank">鏉?鏄?/a> 2010-10-02 12:44 <a href="http://m.tkk7.com/jnbzwm/archive/2010/10/02/333647.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎵╁睍Spring-瀹炵幇瀵瑰閮ㄥ紩鐢ㄧ殑灞炴ф枃浠剁殑 灞炴у?榪涜鍔犲瘑銆佽В瀵?/title><link>http://m.tkk7.com/jnbzwm/archive/2010/09/30/333541.html</link><dc:creator>鏉?鏄?/dc:creator><author>鏉?鏄?/author><pubDate>Thu, 30 Sep 2010 06:34:00 GMT</pubDate><guid>http://m.tkk7.com/jnbzwm/archive/2010/09/30/333541.html</guid><wfw:comment>http://m.tkk7.com/jnbzwm/comments/333541.html</wfw:comment><comments>http://m.tkk7.com/jnbzwm/archive/2010/09/30/333541.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jnbzwm/comments/commentRss/333541.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jnbzwm/services/trackbacks/333541.html</trackback:ping><description><![CDATA[     鎽樿: 褰撴垜浠湪浣跨敤Spring榪涜寮鍙戞椂錛屾垜浠粡甯鎬嬌鐢ㄥ崰浣嶇寮曠敤灞炴ф枃浠剁殑灞炴у兼潵綆鍖栨垜浠殑閰嶇疆鍙婁嬌鎴戜滑鐨勯厤緗叿鏈夋洿楂樼殑鐏墊椿鎬у拰閫氱敤鎬с?浣跨敤榪欑鏂瑰紡鐨勫ソ澶勮繖閲屽氨涓嶈禈榪頒簡錛岃繖閲岃璁茬殑鏄庢牱瀵規澶栭儴灞炴ф枃浠剁殑灞炴у艱繘琛屽姞瀵嗐佽В瀵嗐?浠ヤ笅鏄垜浠啛鎮夌殑閰嶇疆錛歫dbc.properties driver=oracle.jdbc.OracleDriver dburl=jdbc:oracle:thin:@1...  <a href='http://m.tkk7.com/jnbzwm/archive/2010/09/30/333541.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/jnbzwm/aggbug/333541.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jnbzwm/" target="_blank">鏉?鏄?/a> 2010-09-30 14:34 <a href="http://m.tkk7.com/jnbzwm/archive/2010/09/30/333541.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>欏烘墜鐗?Spring涓殑PropertyPlaceholderConfigurer.javahttp://m.tkk7.com/jnbzwm/archive/2010/09/13/331898.html鏉?鏄?/dc:creator>鏉?鏄?/author>Mon, 13 Sep 2010 07:44:00 GMThttp://m.tkk7.com/jnbzwm/archive/2010/09/13/331898.htmlhttp://m.tkk7.com/jnbzwm/comments/331898.htmlhttp://m.tkk7.com/jnbzwm/archive/2010/09/13/331898.html#Feedback2http://m.tkk7.com/jnbzwm/comments/commentRss/331898.htmlhttp://m.tkk7.com/jnbzwm/services/trackbacks/331898.html闃呰鍏ㄦ枃

]]>
Quartz+Spring 鑷畾涔変綔涓氳皟搴︼紙浣滀笟鍦―B涓厤緗級http://m.tkk7.com/jnbzwm/archive/2010/09/06/331239.html鏉?鏄?/dc:creator>鏉?鏄?/author>Mon, 06 Sep 2010 11:08:00 GMThttp://m.tkk7.com/jnbzwm/archive/2010/09/06/331239.htmlhttp://m.tkk7.com/jnbzwm/comments/331239.htmlhttp://m.tkk7.com/jnbzwm/archive/2010/09/06/331239.html#Feedback0http://m.tkk7.com/jnbzwm/comments/commentRss/331239.htmlhttp://m.tkk7.com/jnbzwm/services/trackbacks/331239.html闃呰鍏ㄦ枃

]]>
主站蜘蛛池模板: 久久精品国产亚洲AV不卡| 亚洲精品成人网站在线观看| 美女视频黄视大全视频免费的| 亚洲国产香蕉人人爽成AV片久久 | 最近的2019免费中文字幕| 精品日韩亚洲AV无码| 日韩高清免费在线观看| 成人妇女免费播放久久久| 亚洲手机中文字幕| 免费一级e一片在线播放| 国产va在线观看免费| 亚洲国产精品网站在线播放| 亚洲乱码无码永久不卡在线| 真人做人试看60分钟免费视频| 美女被免费网站在线视频免费 | 久久综合亚洲色HEZYO社区| 国产中文字幕免费| 99久久久国产精品免费蜜臀| 美女隐私免费视频看| 亚洲成a人片在线观看中文app | 国产精品无码免费视频二三区| 在线看片免费人成视频播| 亚洲JIZZJIZZ妇女| 91在线亚洲精品专区| 亚洲日韩在线第一页| 成人毛片18女人毛片免费视频未| 男人天堂免费视频| 亚洲αⅴ无码乱码在线观看性色| 久久久久亚洲av无码专区| 久久久久亚洲精品中文字幕| 成年女人喷潮毛片免费播放| 久久99精品免费视频| 国产成人1024精品免费| 亚洲AV电影天堂男人的天堂| 亚洲成AV人综合在线观看 | 亚洲砖码砖专无区2023| 亚洲第一视频网站| 美腿丝袜亚洲综合| 免费国产成人午夜电影| 黄瓜视频高清在线看免费下载| 久久99精品免费视频|