httpclient遇到CircularRedirectException的处理

文章作者 100test 发表时间 2007:10:31 12:48:21
来源 100Test.Com百考试题网


利用httpclient时;
报错信息:org.apache.commons.httpclient.CircularRedirectException: Circular redirect to ‘http://****’
将redirect设为false,手动处理httpclient的重定位:
Header locationHeader = method.getResponseHeader(
"location").
client.getParams().setParameter("http.socket.timeout",
new Integer(60000 * 10)).
Header host = method.getRequestHeader("host").
method = new GetMethod("http://" host.getValue()
locationHeader.getValue()).
method.setFollowRedirects(false).
处理时最好加上次数限制,防止出现死循环

相关文章


Java正则表达式自义bean
在Swing的JEditorPane控件中实现超级链接的C 定义
不用编译,怎样用jb单步调试ofbiz3?
用apachejames做简单的垃圾邮件过滤网关
httpclient遇到CircularRedirectException的处理
Java实时多任务调度过程中的安全监控设计
破解ZelixKla Master的字符串加密
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛