锘??xml version="1.0" encoding="utf-8" standalone="yes"?>77777_亚洲午夜久久多人,亚洲第一页在线播放,亚洲一区二区三区自拍公司http://www.tkk7.com/scud/category/45643.html灞辮胺閲岄笩璇姳棣?婧按娼烘膠zh-cnSun, 17 Oct 2010 02:44:01 GMTSun, 17 Oct 2010 02:44:01 GMT60浣跨敤ZooKeeper涓篊XF鎴栧叾浠栨湇鍔″姩鎬佹洿鏂版湇鍔″櫒淇℃伅http://www.tkk7.com/scud/archive/2010/10/16/335301.htmlScud(椋炰簯灝忎緺)Scud(椋炰簯灝忎緺)Sat, 16 Oct 2010 11:37:00 GMThttp://www.tkk7.com/scud/archive/2010/10/16/335301.htmlhttp://www.tkk7.com/scud/comments/335301.htmlhttp://www.tkk7.com/scud/archive/2010/10/16/335301.html#Feedback0http://www.tkk7.com/scud/comments/commentRss/335301.htmlhttp://www.tkk7.com/scud/services/trackbacks/335301.html
  闃呰鍏ㄦ枃

Scud(椋炰簯灝忎緺) 2010-10-16 19:37 鍙戣〃璇勮
]]>
鎵╁睍CXF, 鏀寔LoadBalance璐熻澆鍧囪 http://www.tkk7.com/scud/archive/2010/10/15/335224.htmlScud(椋炰簯灝忎緺)Scud(椋炰簯灝忎緺)Fri, 15 Oct 2010 05:01:00 GMThttp://www.tkk7.com/scud/archive/2010/10/15/335224.htmlhttp://www.tkk7.com/scud/comments/335224.htmlhttp://www.tkk7.com/scud/archive/2010/10/15/335224.html#Feedback0http://www.tkk7.com/scud/comments/commentRss/335224.htmlhttp://www.tkk7.com/scud/services/trackbacks/335224.html

CXF鏄竴涓瘮杈冩祦琛岀殑Web Service妗嗘灦. ( 褰撶劧濡傛灉榪芥眰鏇撮珮鏁? 榪樺彲浠ュ幓鎼滅儲(chǔ)ice, thrift, protobuff涔嬬被鐨?

榪戜竴涓湀, 鏂柇緇畫鍦板張濂藉ソ鐪嬩簡(jiǎn)鐪婥XF鐨勪竴浜涗唬鐮? CXF鐨勬枃妗h繕鏄緢嬈犵己,鐗瑰埆鏄叧浜庡唴閮ㄥ疄鐜扮殑涓滆タ. 浠庢垜鐨勬劅瑙夋潵璇? 鍐呴儴瀹炵幇榪樻槸鎸哄鏉傜殑. Inteceptor, Feature, ConduitSelector 榪欎簺姒傚康涓澶у爢, 鍙堝樊涓嶅鍙互鍋氱被浼肩殑浜嬫儏, 鐪熸槸璁╀漢澶存檿.


CXF鏈韓鎻愪緵浜?jiǎn)涓涓狥ailoverFeature, 鍙互鍦ㄨ皟鐢ㄦ湇鍔″嚭閿欐椂鍒囨崲鍒板叾浠栨湇鍔″櫒, 浣嗘槸鏃犳硶鍋氬埌璐熻澆鍧囪 , 鎴戠爺絀朵簡(jiǎn)鍑犲ぉ, 鍦‵ailoverFeature鐨勫熀紜涓婃敼鍑烘潵涓涓狶oadBalanceFeature, 褰撶劧涔熷悓鏃舵敮鎸丗ailover.

棣栧厛鎴戜滑鏉ョ湅鐪嬪浣曚嬌鐢–XF鐨凢ailoverFeature: (涓嬭澆紺轟緥涓寘鎷嬌鐢▁ml鍜屼唬鐮佷袱縐嶆柟寮? 褰撶劧CXF鑷繁榪樻彁渚涗簡(jiǎn)浣跨敤wsdl鍐呴儴瀹氫箟鐨勬柟寮?

    鎴戜滑闇瑕佸厛鍑嗗涓涓狧elloService, 闈炲父綆鍗曠殑涓涓猈eb Service, 榪欓噷涓嶅湪璐村嚭, 鍏蜂綋鍙互鐪嬩笅杞藉寘
    璋冪敤浠g爜紺轟緥:

package org.javascud.extensions.cxf.testfailover;

import org.apache.cxf.clustering.FailoverFeature;
import org.apache.cxf.clustering.RandomStrategy;
import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.javascud.extensions.cxf.service.Hello;

import java.util.ArrayList;
import java.util.List;

public class HelloServiceFailOverClient
{
    
public static void main(String[] args)
    {
        String helloFirst 
= "http://localhost:8080/service/Hello";
        String helloSecond 
= "http://localhost:8081/service/Hello";
        String helloThird 
= "http://localhost:8082/service/Hello";
        String helloFour 
= "http://localhost:8083/service/Hello";

        List
<String> serviceList = new ArrayList<String>();
        serviceList.add(helloFirst);
        serviceList.add(helloSecond);
        serviceList.add(helloThird);
        
//serviceList.add(helloFour);

        RandomStrategy strategy 
= new RandomStrategy();
        strategy.setAlternateAddresses(serviceList);

        FailoverFeature ff 
= new FailoverFeature();
        ff.setStrategy(strategy);

        JaxWsProxyFactoryBean factory 
= new JaxWsProxyFactoryBean();

        List
<AbstractFeature> features = new ArrayList<AbstractFeature>();
        features.add(ff);

        factory.setFeatures(features);
        factory.initFeatures();

        factory.setServiceClass(Hello.
class);
        
//factory.setAddress("http://localhost:8080/service/Hello");

        Hello client 
= (Hello) factory.create();
        String result 
= client.sayHello("felix");
        System.out.println(
"result is: " + result);
    }
}


鍦ㄩ亣鍒伴敊璇椂鍙互鑷姩浣跨敤涓嬩竴涓湇鍔″櫒, 浣嗘槸蹇呴』瑕佽嚜宸辮緗竴涓湴鍧, 濡傛灉涓嶈緗殑璇濅篃鍙互, 浣嗘槸浼?xì)鍑洪敊鐒跺悗failover.


涓嬮潰鎴戜滑鑷繁鏉ョ湅鐪嬫垜浠殑 LoadBalanceFeature

1. 棣栧厛鎴戜滑鍒涘緩涓涓狶oadBalanceFeature (瀹屽叏鍜孎ailoverFeature涓鏍?

   Feature鏄敤鏉ュ畾鍒禨erver, Client, Bus鐨勪竴涓粍浠? 鍏蜂綋鍙互鏌ョ湅AbstractFeature, 鎴戜滑浣跨敤initialize鏂規(guī)硶鏉ュ畾鍒禖lient, 淇敼Client鐨凜onduit閫夋嫨鍣ㄨ揪鍒拌礋杞藉潎琛$殑鐩殑.

   LoadBalanceFeature浠g爜濡備笅:

/**
 * This feature may be applied to a Client so as to enable
 * load balance , use any compatible endpoint for the target service.
 *
 * 
@author Felix Zhang   Date:2010-10-3 22:58
 * 
@see org.apache.cxf.clustering.FailoverFeature
 
*/
public class LoadBalanceFeature extends AbstractFeature {
    
private LoadBalanceStrategy loadBalanceStrategy;

    @Override
    
public void initialize(Client client, Bus bus) {
        LoadBalanceTargetSelector selector 
= new LoadBalanceTargetSelector();
        selector.setEndpoint(client.getEndpoint());
        selector.setStrategy(getStrategy());
        client.setConduitSelector(selector);
    }

    
public void setStrategy(LoadBalanceStrategy strategy) {
        loadBalanceStrategy 
= strategy;
    }

    
public LoadBalanceStrategy getStrategy() {
        
return loadBalanceStrategy;
    }

}




2. 瀹氬埗涓涓狶oadBalanceStrategy 璐熻澆鍧囪 絳栫暐
璐熻澆鍧囪 絳栫暐鏈夊緢澶氱, 渚嬪闅忔満閫夋嫨, 欏哄簭閫夋嫨絳? FailoverFeature鎻愪緵浜?jiǎn)涓壙U嶇瓥鐣? 鎬諱箣寰堢畝鍗? 鎴戜滑鍦ㄨ繖閲屽氨鍏堝疄鐜伴殢鏈虹瓥鐣? 鍏朵粬鐨勭瓥鐣ラ兘寰堢畝鍗? 鍑犺浠g爜灝卞彲浠ュ疄鐜頒簡(jiǎn).

    榪欎釜綾諱富瑕佺敤鏉ヨ緗?鑾峰彇鎵鏈夌殑鎻愪緵鏈嶅姟鐨勫湴鍧鍒楄〃, 涓轟簡(jiǎn)鏂逛究鎺у埗, 鎴戞柊澧炰簡(jiǎn)2涓夐」:
    A: alwaysChangeEndpoint 鏄惁姣忔璇鋒眰閮藉垏鎹㈠湴鍧:銆濡傛灉鍙湁涓涓鎴風(fēng), 鍙互鍒嗘媴璐熻澆. 緙虹渷涓簍rue
    B: removeFailedEndpoint 鏄惁浠庡叏灞鐨勫湴鍧鍒楄〃涓Щ闄ゅけ璐ユ湇鍔″湴鍧 -- 濡傛灉浣犳病鏈夌洃嫻嬫湇鍔″櫒鐘舵佺殑紼嬪簭

   鍏充簬鍔ㄦ佸鍒犳湇鍔″湴鍧
  • 鍙互浣跨敤zookeeper絳夋湇鍔″疄鏃剁洃嫻嬫湇鍔″櫒鐘舵? 鎴栬呰嚜宸卞啓紼嬪簭瀹炵幇, 璋冪敤strategy.setAlternateAddresses鍗沖彲.
  • removeFailedEndpoint 濡傛灉璁劇疆涓簍rue, 浣嗘病鏈夌洃嫻嬫湇鍔″櫒鐘舵佺殑紼嬪簭, 鏂板鐨勬垨鑰呭媧葷殑鏈嶅姟鍣ㄥ垯鏃犳硶琚仮澶嶅埌鍦板潃鍒楄〃涓?
  • 鑰冭檻鍒版晥鐜囧拰鏀寔failover, 璁劇疆鍦板潃鍒楄〃, 縐婚櫎鍦板潃絳夋病鏈夊悓姝ラ攣.
  • 鑷姩縐婚櫎澶辮觸鏈嶅姟鍦板潃鏃? 鐩墠浠呮敮鎸佹墜鍔ㄥ湴鍧鍒楄〃, 娌℃湁鑰冭檻wsdl涓殑澶氭湇鍔″湴鍧.
  • 鍚庣畫鎴戜細(xì)鍐欎竴涓嬌鐢▃ookeeper澧炲垹鏈嶅姟鍦板潃鍒楄〃鐨勭ず渚? (鏈榪戜篃鍦ㄧ湅zookeeper)


   涓昏鐨勪唬鐮侀兘鍦ˋbstractLoadBalanceStrategy 涓? 鍩烘湰鍜?AbstractStaticFailoverStrategy 涓鏍? 娣誨姞浜?jiǎn)涓涓猺emoveAlternateAddress 鐢ㄤ簬縐婚櫎澶辮觸鐨勬湇鍔″湴鍧.

    LoadBalanceStrategy 鎺ュ彛鐨勪唬鐮佸涓?

/**
 * Supports pluggable strategies for alternate endpoint selection on
 * load balance.
 * <p/>
 * Random, Retries, Mod (later)
 * <p/>
 * 1. support load balance  2.support fail over.
 *
 * 
@author Felix Zhang   Date:2010-10-1 18:14
 * 
@see org.apache.cxf.clustering.FailoverStrategy
 
*/
public interface LoadBalanceStrategy {

    
/**
     * Get the alternate endpoints for this invocation.
     *
     * 
@param exchange the current Exchange
     * 
@return a failover endpoint if one is available
     
*/
    List
<Endpoint> getAlternateEndpoints(Exchange exchange);

    
/**
     * Select one of the alternate endpoints for a retried invocation.
     *
     * 
@param alternates List of alternate endpoints if available
     * 
@return the selected endpoint
     
*/
    Endpoint selectAlternateEndpoint(List
<Endpoint> alternates);

    
/**
     * Get the alternate addresses for this invocation.
     * These addresses over-ride any addresses specified in the WSDL.
     *
     * 
@param exchange the current Exchange
     * 
@return a failover endpoint if one is available
     
*/
    List
<String> getAlternateAddresses(Exchange exchange);

    
/**
     * Select one of the alternate addresses for a retried invocation.
     *
     * 
@param addresses List of alternate addresses if available
     * 
@return the selected address
     
*/
    String selectAlternateAddress(List
<String> addresses);

    
/**
     * should remove failed endpoint or not.
     * only work for user defined addresses list.
     * 
@return true or false
     
*/
    
boolean isRemoveFailedEndpoint();

    
/**
     * change endpoint every time or not.
     * 
@return boolean
     
*/
    
boolean isAlwaysChangeEndpoint();

    
/**
     * remove failed address from list.
     * 
@param address the failed address
     
*/
    
void removeAlternateAddress(String address);
}



    RandomLoadBalanceStrategy緇ф壙鑷?AbstractLoadBalanceStrategy, 鍜?RandomStrategy鐨勫尯鍒氨鏄幏鍙栦笅涓涓湇鍔″湴鍧鏃跺茍涓嶄粠鍒楄〃涓Щ闄ゆ鍦板潃, 鍚﹀垯灝卞仛涓嶅埌璐熻澆鍧囪 浜?


3. 鏈閲嶈鐨?LoadBalanceTargetSelector
    A: 榪欎釜綾繪瘮杈冨鏉? 鎴戜滑涓轟簡(jiǎn)瀹炵幇璐熻澆鍧囪 , 淇敼浜?strong>prepare鏉ュ姩鎬佽緗皟鐢ㄧ殑endpoint, 鏇挎崲絳栫暐鍙栧喅浜嶭oadBalanceStrategy
    涓昏浠g爜濡備笅:

            boolean existsEndpoint = false;
            
//check current endpoint is not null
            Endpoint theEndpoint = exchange.get(Endpoint.class);
            
if (theEndpoint.getEndpointInfo().getAddress() != null) {
                existsEndpoint 
= true;
            }

            Endpoint nextEndpoint;
            
if (getStrategy().isAlwaysChangeEndpoint() || !existsEndpoint) {
                
//get a endpoint and set to current endpoint
                Endpoint loadBalanceTarget = getLoadBalanceTarget(exchange);
                
if (loadBalanceTarget != null) {
                    logger.info(
"switch to next target: " + loadBalanceTarget.getEndpointInfo().getAddress());
                    setEndpoint(loadBalanceTarget);

                    
//update exchange.org.apache.cxf.message.Message.ENDPOINT_ADDRESS --- 涓嶈緗繖涓氨鐢ㄤ笂嬈$殑濂囨?/span>
                    message.put(Message.ENDPOINT_ADDRESS, loadBalanceTarget.getEndpointInfo().getAddress());
                }

                nextEndpoint 
= loadBalanceTarget;
            } 
else {
                
//use current endpoint
                nextEndpoint = theEndpoint;
            }




   
    B:涓轟簡(jiǎn)鍜屽師鏈塅ailover鐗規(guī)у吋瀹? 鎴戜滑淇敼浜?getFailoverTarget鍑芥暟, 鍦ㄦ鍑芥暟涓縐婚櫎澶辮觸鐨勬湇鍔″湴鍧, 鍥犱負(fù)鍦ㄤ箣鍓嶆垜浠慨鏀逛簡(jiǎn)LoadBalanceStrategy, 瀹冨湪鑾峰彇鍦板潃鏃朵笉鍐嶇Щ闄ゅ綋鍓嶅湴鍧, 鎵浠ユ垜浠渶瑕佹墜鍔ㄧЩ闄?

    閮ㄥ垎浠g爜濡備笅:   
            String currentAddress = getEndpoint().getEndpointInfo().getAddress();

            
//failover should remove current endpoint first, then get next -- 鏍規(guī)嵁瀹氫箟鐨勭瓥鐣ユ潵鍐沖畾鏄惁浠庡叏灞鍦板潃鍒楄〃涓Щ闄?/span>
            if (getStrategy().isRemoveFailedEndpoint()) {
                logger.warn(
"remove current failed address: " + currentAddress);
                
//remove for client, not for current invocation -- 娌℃湁鍚屾閿?/span>
                getStrategy().removeAlternateAddress(currentAddress);
            }

            
//remove for current invocation: 褰撳墠璇鋒眰涓繪槸縐婚櫎澶辮觸鏈嶅姟鍦板潃
            alternateAddresses.remove(currentAddress);

            String alternateAddress 
=
                    getStrategy().selectAlternateAddress(alternateAddresses);





4. 璋冪敤瀹炰緥:

   姝ゅ鎴戜滑閲囩敤XML瀹氫箟鏂瑰紡:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws
="http://cxf.apache.org/jaxws"
       xmlns:clustering
="http://cxf.apache.org/clustering"
       xmlns:util
="http://www.springframework.org/schema/util"
       xsi:schemaLocation
="
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
>

    
<util:list id="addressList">
        
<value>http://localhost:8081/service/Hello</value>
        
<value>http://localhost:8082/service/Hello</value>
        
<value>http://localhost:8083/service/Hello</value>
        
<value>http://localhost:8086/service/Hello</value>
        
<value>http://localhost:8087/service/Hello</value>
        
<value>http://localhost:8088/service/Hello</value>
    
</util:list>

    
<bean id="SequentialAddresses" class="org.apache.cxf.clustering.SequentialStrategy">
        
<property name="alternateAddresses">
            
<ref bean="addressList"/>
        
</property>
    
</bean>

    
<bean id="randomAddresses" class="org.javascud.extensions.cxf.RandomLoadBalanceStrategy">
        
<property name="alternateAddresses">
            
<ref bean="addressList"/>
        
</property>
        
<property name="removeFailedEndpoint" value="true" />
    
</bean>

    
<bean id="loadBalanceFeature" class="org.javascud.extensions.cxf.LoadBalanceFeature">
        
<property name="strategy" ref="randomAddresses" />
    
</bean>


    
<jaxws:client name="helloClient"
                  serviceClass
="org.javascud.extensions.cxf.service.Hello"            >
        
<jaxws:features>
            
<ref bean="loadBalanceFeature" />
        
</jaxws:features>
    
</jaxws:client>


</beans>
 
8081, 8082, 8083鏄疄闄呭瓨鍦ㄧ殑鏈嶅姟, 鍏朵粬鐨勪笉瀛樺湪.


璋冪敤鐨凧ava浠g爜:

package org.javascud.extensions.cxf.loadbalance;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.javascud.extensions.cxf.LoadBalanceStrategy;
import org.javascud.extensions.cxf.service.Hello;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class HelloLoadBalanceAndFailOverClientByXML
{
    
public static void main(String[] args)
    {
        ClassPathXmlApplicationContext context
                
= new ClassPathXmlApplicationContext(new String[]
                {
"org/javascud/extensions/cxf/loadbalance/loadbalance_fail.xml"});
        Hello client 
= (Hello) context.getBean("helloClient");

        LoadBalanceStrategy strategy 
= (LoadBalanceStrategy) context.getBean("randomAddresses");

        Client myclient 
= ClientProxy.getClient(client);
        String address 
= myclient.getEndpoint().getEndpointInfo().getAddress();

        System.out.println(address);

        
for(int i=1; i<=20; i++)
        {
            String result1 
= client.sayHello("Felix" +i);
            System.out.println(
"Call " + i +"" + result1);

            
int left = strategy.getAlternateAddresses(null).size();
            System.out.println(
"================== left " + left + " ===========================");
        }


    }
}

    姝ゅ浠呬粎涓烘ā鎷熸祴璇?


5. 鍏充簬嫻嬭瘯鐢ㄤ緥
    娌℃兂濂藉浣曞啓鍗曞厓嫻嬭瘯, test閲岄潰鐩墠閮芥槸闅忔剰嫻嬭瘯鐨勪唬鐮? 鍩烘湰鐓ч【鍒版墍鏈夊姛鑳?

    

6. 涓嬭澆
浠g爜涓嬭澆: http://cnscud.googlecode.com/files/extensions-cxf_20101015.zip
婧愮爜浣嶇疆: http://cnscud.googlecode.com/svn/trunk/extensions/  鍏朵腑cxf鐩綍鏄鏂囩珷鐩稿叧鐨勬簮鐮?

7. 鏈変換浣曢棶棰樿鐣欒█.


杞澆璇鋒敞鏄庝綔鑰呭拰鍑哄 http://scud.blogjava.net





Scud(椋炰簯灝忎緺) 2010-10-15 13:01 鍙戣〃璇勮
]]>
CXF restful webserice鍚屾椂鏀寔鍑犵鍗忚 json, xml... 寰堢畝鍗?/title><link>http://www.tkk7.com/scud/archive/2010/07/20/326587.html</link><dc:creator>Scud(椋炰簯灝忎緺)</dc:creator><author>Scud(椋炰簯灝忎緺)</author><pubDate>Mon, 19 Jul 2010 16:30:00 GMT</pubDate><guid>http://www.tkk7.com/scud/archive/2010/07/20/326587.html</guid><wfw:comment>http://www.tkk7.com/scud/comments/326587.html</wfw:comment><comments>http://www.tkk7.com/scud/archive/2010/07/20/326587.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/scud/comments/commentRss/326587.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/scud/services/trackbacks/326587.html</trackback:ping><description><![CDATA[1. 鍋囪鎴戜滑鏈変釜鏈嶅姟  (閮芥槸浠庡埆澶勬嬁鏉ョ殑浠g爜)<br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);">mport javax.ws.rs.</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.ws.rs.core.Response;<br /> <br /> <br /> @Path(value </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/student/{id}</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)<br /> </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">interface</span><span style="color: rgb(0, 0, 0);"> StudentService<br /> {<br />     @GET<br />     @Path(value </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/info</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)<br />     Student getStudent(@PathParam(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">id</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);"> id, @QueryParam(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)<br />     String name);<br /> <br />     @GET<br />     @Path(value </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/info2</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)<br />     UserResponse getStudent(@QueryParam(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) String name);<br /> }</span></div> <br /> 鏈嶅姟瀹炵幇綾? <br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.ws.rs.core.Response;<br /> </span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.text.ParseException;<br /> </span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.text.SimpleDateFormat;<br /> <br /> </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> StudentServiceImpl </span><span style="color: rgb(0, 0, 255);">implements</span><span style="color: rgb(0, 0, 0);"> StudentService<br /> {<br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> Student getStudent(</span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);"> id, String name)<br />     {<br />         Student s </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Student();<br />         s.setId(id);<br />         s.setName(name);<br />         </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br />         {<br />             s.setBirthday(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> SimpleDateFormat(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">yyyy-MM-dd</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).parse(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">1983-04-26</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (ParseException e)<br />         {<br />             e.printStackTrace();<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> s;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> Response getStudent1(String name)<br />     {<br />         Student s </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Student();<br />         s.setId(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">);<br />         s.setName(name);<br />         </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br />         {<br />             s.setBirthday(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> SimpleDateFormat(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">yyyy-MM-dd</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).parse(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">1983-04-26</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (ParseException e)<br />         {<br />             e.printStackTrace();<br />         }<br /> <br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> Response.ok(s).build();<br />         </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">return s;</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 0, 0);">    }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> UserResponse getStudent(String name)<br />     {<br />         Student s </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Student();<br />         s.setId(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">);<br />         s.setName(name);<br />         </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br />         {<br />             s.setBirthday(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> SimpleDateFormat(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">yyyy-MM-dd</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).parse(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">1983-04-26</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (ParseException e)<br />         {<br />             e.printStackTrace();<br />         }<br /> <br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> UserResponse(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">ok</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, s);<br />     }</span></div> <br /> 榪斿洖鏁版嵁鍖呰綾?br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.xml.bind.annotation.</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">;<br /> <br /> @XmlRootElement(name </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Response</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)<br /> @XmlAccessorType(XmlAccessType.FIELD)<br /> </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> UserResponse<br /> {<br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> String status;<br /> <br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> Student data;<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> UserResponse()<br />     {<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> UserResponse(String status, Student data)<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.status </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> status;<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.data </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> data;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> String getStatus()<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> status;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setStatus(String status)<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.status </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> status;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> Object getData()<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> data;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setData(Student data)<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.data </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> data;<br />     }<br /> }<br /> </span></div> <br /> 鏅氱被<br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.xml.bind.annotation.XmlAccessType;<br /> </span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.xml.bind.annotation.XmlAccessorType;<br /> </span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.xml.bind.annotation.XmlRootElement;<br /> </span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.Date;<br /> <br /> @XmlRootElement(name </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Student</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)<br /> @XmlAccessorType(XmlAccessType.FIELD)<br /> </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> Student<br /> {<br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);"> id;<br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> String name;<br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> Date birthday;<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);"> getId()<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> id;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setId(</span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);"> id)<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.id </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> id;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> String getName()<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> name;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setName(String name)<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.name </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> name;<br />     }<br /> <br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> Date getBirthday()<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> birthday;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setBirthday(Date birthday)<br />     {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.birthday </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> birthday;<br />     }<br /> }</span></div> <br /> <br /> <br /> Spring 鏈嶅姟澹版槑<br /> <br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">import </span><span style="color: rgb(255, 0, 0);">resource</span><span style="color: rgb(0, 0, 255);">="classpath:META-INF/cxf/cxf.xml"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">import </span><span style="color: rgb(255, 0, 0);">resource</span><span style="color: rgb(0, 0, 255);">="classpath:META-INF/cxf/cxf-extension-soap.xml"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">import </span><span style="color: rgb(255, 0, 0);">resource</span><span style="color: rgb(0, 0, 255);">="classpath:META-INF/cxf/cxf-servlet.xml"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">import </span><span style="color: rgb(255, 0, 0);">resource</span><span style="color: rgb(0, 0, 255);">="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /> <br /> <br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bean </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="rsStudentServiceImpl"</span><span style="color: rgb(255, 0, 0);"> class</span><span style="color: rgb(0, 0, 255);">="ex3.StudentServiceImpl"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br /> <br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">jaxrs:server </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="test"</span><span style="color: rgb(255, 0, 0);"> address</span><span style="color: rgb(0, 0, 255);">="/student"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">jaxrs:serviceBeans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />             </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">ref </span><span style="color: rgb(255, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">="rsStudentServiceImpl"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">jaxrs:serviceBeans</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />           <br />          <!-- 榪欓噷璁劇疆浜?jiǎn)瀵瑰簲鍏尘p? 鎸夌悊璇撮粯璁ゅ氨搴旇鏄繖鏍? 浣犲彲浠ヨ瘯璇? 褰撶劧鍙互鑷畾涔?nbsp; --><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">jaxrs:extensionMappings</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />           </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">entry </span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="json"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="application/json"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />           </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">entry </span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="xml"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="application/xml"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">jaxrs:extensionMappings</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">jaxrs:server</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span></div> <br /> web.xml 灝變笉璐翠簡(jiǎn), 鍜屾櫘閫氱殑涓鏍?<br /> <br /> <br /> <br /> 2. 璁塊棶鏂規(guī)硶鏈?縐? 鍙互瀹炵幇鑾峰彇涓嶅悓鏍煎紡鐨勫唴瀹?<br /> <br /> http://localhost:8080/student/student/3/info2.json?name=abcss<br /> http://localhost:8080/student/student/3/info2.xml?name=abcss<br /> <br /> http://localhost:8080/student/student/3/info2?name=abcss&_type=xml<br /> http://localhost:8080/student/student/3/info2?name=abcss&_type=json<br /> <br /> 榪樻湁涓縐嶅姙娉曞氨鏄湪璇鋒眰鏃惰緗瓵ccept:<br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);">        HttpGet get </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> HttpGet(<br />                 </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://127.0.0.1:8080/student/student/3/info2?name=Fetion</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />         HttpClient httpclient </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> DefaultHttpClient();<br /> <br />         get.addHeader(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">ACCEPT</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">application/xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /> <br />         HttpResponse response </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> httpclient.execute(get);<br /> <br />         StatusLine st </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> response.getStatusLine();<br /> <br />     InputStream ins </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> response.getEntity().getContent();<br />     </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[] b </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 0);">1024</span><span style="color: rgb(0, 0, 0);">];<br />     StringBuilder sb </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> StringBuilder();<br />     </span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);"> (ins.read(b) </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)<br />     {<br />         sb.append(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> String(b, </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">UTF-8</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />     }<br />     System.out.println(sb.toString());<br /> </span></div> <br /> 綆鍗曞惂.... 鍛靛懙 <br /> <br /> <br /> <img src ="http://www.tkk7.com/scud/aggbug/326587.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/scud/" target="_blank">Scud(椋炰簯灝忎緺)</a> 2010-07-20 00:30 <a href="http://www.tkk7.com/scud/archive/2010/07/20/326587.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://ttooyuyu.com" target="_blank">另类专区另类专区亚洲</a>| <a href="http://12345ww.com" target="_blank">免费人成激情视频在线观看冫</a>| <a href="http://hgbookvip.com" target="_blank">亚洲国产午夜中文字幕精品黄网站</a>| <a href="http://86trader.com" target="_blank">国产无限免费观看黄网站</a>| <a href="http://by33321.com" target="_blank">久久亚洲AV成人无码国产</a>| <a href="http://246210.com" target="_blank">女人毛片a级大学毛片免费</a>| <a href="http://www-qwh.com" target="_blank">www免费黄色网</a>| <a href="http://zjhydouyaji.com" target="_blank">亚洲色成人网一二三区</a>| <a href="http://xxxxcccc.com" target="_blank">国产在线19禁免费观看国产</a>| <a href="http://416164.com" target="_blank">性无码免费一区二区三区在线</a>| <a href="http://www91pao.com" target="_blank">亚洲а∨天堂久久精品9966</a>| <a href="http://117949b.com" target="_blank">亚洲小说区图片区另类春色</a>| <a href="http://www-091w.com" target="_blank">成人免费午夜在线观看</a>| <a href="http://1897tao.com" target="_blank">国产精品99爱免费视频</a>| <a href="http://snsdtv.com" target="_blank">亚洲综合精品成人</a>| <a href="http://imfever.com" target="_blank">亚洲AV永久无码精品水牛影视</a>| <a href="http://44168888.com" target="_blank">精品久久久久久久免费加勒比</a>| <a href="http://xyyfamily.com" target="_blank">玖玖在线免费视频</a>| <a href="http://youyou8tv.com" target="_blank">亚洲AV无码国产一区二区三区</a>| <a href="http://www19977.com" target="_blank">亚洲AV成人片色在线观看高潮</a>| <a href="http://52xingai.com" target="_blank">免费国产高清视频</a>| <a href="http://kencery.com" target="_blank">69堂人成无码免费视频果冻传媒 </a>| <a href="http://5c7m.com" target="_blank">亚洲精品精华液一区二区</a>| <a href="http://67f6.com" target="_blank">伊人久久亚洲综合</a>| <a href="http://www621f.com" target="_blank">国产成人免费高清激情视频</a>| <a href="http://ycjs999.com" target="_blank">久久爰www免费人成</a>| <a href="http://ttvv55.com" target="_blank">亚洲AV无码专区在线厂</a>| <a href="http://xsdin.com" target="_blank">亚洲一区中文字幕在线电影网</a>| <a href="http://1212777.com" target="_blank">亚洲精品自在在线观看</a>| <a href="http://wowo123.com" target="_blank">免费国产在线观看</a>| <a href="http://bdgxhome.com" target="_blank">亚洲中文无码永久免费 </a>| <a href="http://tzkanglong.com" target="_blank">中国xxxxx高清免费看视频</a>| <a href="http://kutuwo.com" target="_blank">国产免费牲交视频免费播放 </a>| <a href="http://tlyyt.com" target="_blank">国产在线jyzzjyzz免费麻豆</a>| <a href="http://my55572.com" target="_blank">久久国产一片免费观看</a>| <a href="http://828556.com" target="_blank">高潮毛片无遮挡高清免费视频</a>| <a href="http://kanboy.com" target="_blank">亚洲中文字幕AV在天堂</a>| <a href="http://6609929.com" target="_blank">亚洲视频日韩视频</a>| <a href="http://25gh.com" target="_blank">久久久影院亚洲精品</a>| <a href="http://yimintech.com" target="_blank">久久久久亚洲AV综合波多野结衣</a>| <a href="http://www91v.com" target="_blank">国产成人免费手机在线观看视频 </a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>