如何在Spring中注入org.apache.http.client.HttpClient?

时间:2015-07-30 16:07:11

标签: java spring apache-httpclient-4.x

我的org.apache.http.client.HttpClient班级中有HttpServiceClientImpl个客户参考。

public class HttpServiceClientImpl implements  HttpServiceClient {

private HttpClient client;

public void createFooStuff(){
 client = HttpClientBuilder.create().build();

}
createFooStuff HttpClientBuilder.create().build()中的

会返回org.apache.http.impl.client.CloseableHttpClient Abstract Class

如何为此注射加入applicationContext ???

0 个答案:

没有答案