HTTP API deprected警告UTF_8,Scheme,ThreadSafeClientConnManager [英] HTTP API deprected warnings UTF_8, Scheme, ThreadSafeClientConnManager
问题描述
我是新的java。我创建了一个java项目来调用我的webservice(Servlet,Tomcat6.0)。
使用http我添加了以下jar文件
1. httpclient-4.2.1
2. httpcore-4.2.1
I'm new java. I created a java project to call my webservice(Servlet,Tomcat6.0).
To use http i had added the following jar files
1. httpclient-4.2.1
2. httpcore-4.2.1
对于下面的方法(以粗体显示),我得到类型已弃用的警告,但无法运行项目。
For methods(In Bold) below i'm getting type deprecated warnings and not able to run the project.
HTTP.**UTF_8**
aSchemeRegistryL.register(new **Scheme**("http", PlainSocketFactory.getSocketFactory(), 80));
ClientConnectionManager ccm = new **ThreadSafeClientConnManager**(aHttpParamsL, aSchemeRegistryL);
帮助我纠正它。
推荐答案
大部分时间 - 检查你的java文档 - 他们会建议另一个类。请参阅:
ThreadSafeClientManager
Most of the time - check your java docs - they'll suggest an alternative class. See: ThreadSafeClientManager
它将建议使用而不是ThreadSafeClientManager:PoolingClientConnectionManager
And it will suggest instead of ThreadSafeClientManager use: PoolingClientConnectionManager
PoolingClientConnectionManager
对于Scheme类,如果查看javadocs,类本身不会被弃用,但您使用的构造函数是:
计划
As for the Scheme class, if you look at the javadocs, the class itself isn't deprecated, but the constructor you are using is: Scheme
这篇关于HTTP API deprected警告UTF_8,Scheme,ThreadSafeClientConnManager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!