解决weblogic下报java.net.ProtocolException: Exceeded stated content-length of异常问题
来源:互联网 发布:微博刷赞软件手机版 编辑:程序博客网 时间:2024/05/28 05:17
今天在做文件下载时出现如何错误:
java.net.ProtocolException: Exceeded stated content-length of: '19456' bytes
我的程序代码是:
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition",
"attachment;filename=/"" + StringI18.u2a(fileName)
+ "/"");
response.setContentLength((int) fileis.size);
ServletOutputStream sos = response.getOutputStream();
byte buffer[] = new byte[1024];
int b=0;
while ((b = fileis.inputStream.read(buffer)) != -1) {
sos.write(buffer, 0, b);
}
sos.flush();
fileis.inputStream.close();
if(fileis.sourceInputStream!=null){
fileis.sourceInputStream.close();
}
sos.close();
经多方查证,主要是因为在weblogic下需要response.reset();
- 解决weblogic下报java.net.ProtocolException: Exceeded stated content-length of异常问题
- java.net.ProtocolException: Exceeded stated content-length of: '6144' bytes
- weblogic 11g java.net.ProtocolException: Exceeded stated content-length of: '13824' bytes
- 关于weblogic下java.net.ProtocolException: Didn't meet stated Content-Length, wrote: 异常
- java.net.ProtocolException: Exceeded stated content-length of: '13824' bytes 用jspSmartUpload.jar下载 出错
- 解决在weblogic上报java.net.ProtocolException: Didn't meet stated Content-Length, wrote: '146592' bytes instead of stated: '462285' by
- 关于weblogic下java.net.ProtocolException: Didn't meet stated Content-Length, wrote:
- Weblogic: Exceeded stated content-length
- 关于weblogic下Did not meet stated content length of OutputStream异常
- Windows部署Weblogic问题:Didn't meet stated Content-Length
- sitemesh 2.4.2在weblogic中Didn't meet stated Content-Length问题
- didn't meet stated Content-length,wrote:'133' bytes instead of stated '204' bytes
- java.net.ProtocolException: unexpected end of stream
- java.net.ProtocolException翻译
- Linux下报 java.net.SocketException权限不够 异常解决
- Linux下报 java.net.SocketException权限不够 异常解决
- ASP.NET 上传控件 “Maximum request length exceeded” 异常
- 解决linux下java报java.net.UnknownHostException问题
- 切换滑动门效果(图,代码下载)
- php+ajax动态生成下拉菜单
- 比google和百度牛的十倍的搜索类网站(一定要收藏,肯定会有用的)
- ASP+AJAX应用之注册用户即时检测
- day day up
- 解决weblogic下报java.net.ProtocolException: Exceeded stated content-length of异常问题
- GridView 中 DataFormatString 的使用
- JavaScript无提示关闭当前页面窗口,兼容IE/Firefox/Chrome (Close the current page window without confirm by JavaScript, support all browsers)
- 为gridview “删除”列添加确认对话框
- RegQueryValueEx函数返回234错误解决方法
- 防止被进程附加调试
- 什么是CSS
- 如何在GridView的RowCommand事件中获取当前的GridViewRow
- CSS元素的定义