if (status == HttpStatus.SC_MOVED_PERMANENTLY || status == HttpStatus.SC_MOVED_TEMPORARILY) {
Header locationHeader = hm.getResponseHeader("location");
String location = null;
if (locationHeader != null) {
location = locationHeader.getValue();
GetMethod redirect=new GetMethod(location);
HttpClient client = new HttpClient();
client.executeMethod(redirect);
if (status_ != HttpStatus.SC_OK) { throw new JobExecutionException("[执行结果=失败][状态码=" + status + "]" + (hm.getStatusLine() == null ? "" : "[信息=" + hm.getStatusText() + "]")); } //responseBody = getPostResponse(location, parts);// 用跳转后的页面重新请求。 } } else if (status == HttpStatus.SC_OK) { responseBody = hm.getResponseBodyAsString(); }else{ //非正常执行,异常处理代码。。 }