日期:2014-05-17  浏览次数:20707 次

使用smartupload下载时遇到的问题
我用smartupload照着网上的例子写了一个下载,但是我发现,如果点击下载之后,马上就确定下载,没问题。但是如果点击取消,再点击下载,就会报错!但是也不影响下载,貌似有一次用手机下载,2.7MB的包下来只有几百k了。想重现一直重现不了了。下边是报的错和下载的代码
2014-1-14 16:46:20 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.io.IOException
at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:717)
at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:747)
at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118)
at org.apache.coyote.http11.InternalAprOutputBuffer.doWrite(InternalAprOutputBuffer.java:557)
at org.apache.coyote.Response.doWrite(Response.java:560)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:364)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:368)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:392)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:381)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
at com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:301)
at com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:261)
at com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:249)
at org.apache.jsp.download_jsp._jspService(download_jsp.java:75)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1760)
at java.lang.Thread.run(Thread.java:619)


下载页面代码
<%@ page language="java" import="java.util.*,com.jspsmart.upload.*,dao.*,entity.*" pageEncoding="UTF-8"%>
<%
//获取下载文件名
      String fileName = request.getParameter("app");
      Integer imageid = Integer.parseInt(request.getParameter("imageid"));
      LypasDaoImpl lypasDaoImpl = new LypasDaoImpl();
    &nbs