java中的response和outputstream,用response.getOutPutStream()流返回excel有关问题

当前位置:我的异常网» Java Web开发 » 用response.getOutPutStream()流返回excel有关问题

用response.getOutPutStream()流返回excel有关问题

www.myexceptions.net  网友分享于:2013-12-28  浏览:201次

用response.getOutPutStream()流返回excel问题

excel已生成,但读取excel返回给客户端的时候,就不行了,数据量小还是可以的,数据量一大60000就不可以啦

ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error

at org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.java:373)

at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:398)

at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:318)

at org.apache.coyote.tomcat5.OutputBuffer.writeBytes(OutputBuffer.java:401)

at org.apache.coyote.tomcat5.OutputBuffer.write(OutputBuffer.java:388)

at org.apache.coyote.tomcat5.CoyoteOutputStream.write(CoyoteOutputStream.java:76)

at java.io.BufferedOutputStream.write(BufferedOutputStream.java:121)

at DP.ploy.Bean.PloyBean.readToExcel(PloyBean.java:171)

at DP.ploy.Bean.PloyBean.writeExcel(PloyBean.java:140)

at org.apache.jsp.ploy.PloyDowloadList_jsp._jspService(PloyDowloadList_jsp.java:72)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Thread.java:568)

------解决方案--------------------

可以不用流,直接生成一个excel后,用window.open("xxx.xls");这样试试啊.

文章评论

参与评论 您还未登录,请先 登录 后发表或查看评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:游动-白 设计师:我叫白小胖 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值