标签:
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); int status_ = http.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{ //非正常执行,异常处理代码。。 }
标签:
原文地址:http://www.cnblogs.com/Struts-pring/p/4301443.html