0
以下線路2:衝突httpclient4.1.jar和httpclient4.2.3.jar
當我使用httpclient4.1.jar在我的庫setRedirectStrategy錯誤刪除,laxRedirect出現錯誤(和laxRedirect進口也採取錯誤)-error(1)所示,
當我使用httpclient4.2.3,laxredirect錯誤取出並setRedirectStrategy錯誤occured-誤差(2)的下方。
我該怎麼辦? (使用4.1或4.2.3,而且必須做的事情chages?)
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.setRedirectStrategy(new LaxRedirectStrategy());
進口:
import org.apache.http.impl.client.LaxRedirectStrategy;
import org.apache.http.impl.client.DefaultHttpClient;
和錯誤是:
1- The method setRedirectStrategy(LaxRedirectStrategy) is undefined for the type DefaultHttpClient
2- LaxRedirectStrategy cannot be resolved to a type
我檢查它,但它建議再次導入「org.apache.http.impl.client.LaxRedirectStrategy」。 – 2014-09-10 21:21:09
錯誤:「進口org.apache.http.impl.client.DefaultRedirectStrategy.LaxRedirectStrategy不能得到解決」 – 2014-09-10 21:28:46
遺憾地說,'setRedirectStrategy'之後4.1.See我的編輯答案棄用。 – 2014-09-10 22:22:15