HttpClient client = new HttpClient();

client.getHostConfiguration().setHost(LOGON_SITE, LOGON_PORT);
String username = argues.getString("username");
String password = argues.getString("password");
String vimg = argues.getString("vimg");
PostMethod post = new PostMethod(
"http://rd2.zhaopin.com/loginmgr/loginproc.asp");
NameValuePair name = new NameValuePair("username", username);
NameValuePair pass = new NameValuePair("password", password);
NameValuePair validate = new NameValuePair("Validate", vimg);
post.setRequestBody(new NameValuePair[] { name, pass, validate }); int status = client.executeMethod(post);
post.releaseConnection(); Log.info(status);
Log.info(post.getResponseBodyAsString());
Log.info(post.getStatusLine().toString());
//打印出返回数据,检验一下是否成功
Log.info(post.getResponseBodyAsString());
// 获得登陆后的 Cookie
Header cookidHeader = post.getResponseHeader("Set-Cookie");
Header header = post.getResponseHeader("location");
// 检查是否重定向
int statuscode = post.getStatusCode();
if ((statuscode == HttpStatus.SC_MOVED_TEMPORARILY)
|| (statuscode == HttpStatus.SC_MOVED_PERMANENTLY)
|| (statuscode == HttpStatus.SC_SEE_OTHER)
|| (statuscode == HttpStatus.SC_TEMPORARY_REDIRECT)) {
// 读取新的 URL 地址
if (header != null) {
String newuri = header.getValue();
if ((newuri == null) || (newuri.equals("")))
newuri = "/";
GetMethod redirect = new GetMethod(newuri);
client.executeMethod(redirect);
Log.info("Redirect:"
+ redirect.getStatusLine().toString());
Log.info("body:"+redirect.getResponseBodyAsString());
redirect.releaseConnection();
} else
System.out.println("Invalid redirect");
}
源码如上,登陆成功,出现了重连接,但是获取到重连接后,无法请求取得冲连接到的地址的内容,麻烦高手解答下,求指点  各种求