0
無法弄清楚爲什麼我在這裏得到空指針:System.out.println(method.getStatusCode()); !? 方法初始化併成功執行! 任何想法? 示例代碼在這裏。我正在使用commons-httpclient-3.1.jar幫助。獲取執行異常PostMethod.getStatusCode()!
PostMethod = new PostMethod(url);
LogInHelper.logRequest(httpClient, method);
try {
httpClient.executeMethod(method);
method.getResponseBodyAsString();
} catch (HttpException e) {
LOG.error("@getSessionId() error connecting to " + url, e);
} catch (IOException e) {
LOG.error("@getSessionId() error connecting to " + url, e);
}
LogInHelper.logResponse(method);
System.out.println(method.getStatusCode());
嗨。這太糟糕了,沒有人回答你的問題。我只是和你有同樣的問題。問題是我總是每天早上清理並重新編譯項目。問題依然存在。我仰望互聯網,沒有像這樣的問題的人。 – 2014-11-10 08:25:17