kxinzhu 2009-07-24 19:03
浏览 305
已采纳

jspsmartUpload组件上传文件问题

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" errorPage="" %>


文件上传处理页面


"); // 逐一提取上传文件信息,同时可保存文件。 for (int i=0;i"); out.println("表单项名(FieldName)"+file.getFieldName()+""); out.println("文件长度(Size)"+file.getSize()+""); out.println("文件名(FileName)"+file.getFileName()+""); out.println("文件扩展名(FileExt)" +file.getFileExt()+""); out.println("文件全名(FilePathName)"+file.getFilePathName()+""); out.println("
"); } %>


其中在浏览器测试的时候 第24行 su.ipload();有错误 。自己检测不出 请指点下我,万分感谢 错误页面:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /part6/doupload.jsp:24

21: // 4.设定禁止上传的文件(通过扩展名限制),禁止上传带有exe,bat,jsp,htm,html扩展名的文件和没有扩展名的文件。
22: //su.setDeniedFilesList("exe,bat,jsp,htm,html,,");
23: // 上传文件
24: su.upload();
25: // 将上传文件全部保存到指定目录
26: int count = su.save("/upload");
27: out.println(count+"个文件上传成功!
");

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

root cause

java.lang.NegativeArraySizeException
com.jspsmart.upload.SmartUpload.upload(SmartUpload.java:108)
org.apache.jsp.part6.doupload_jsp._jspService(doupload_jsp.java:67)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.

万分感谢

  • 写回答

3条回答 默认 最新

  • iteye_20589 2009-07-24 19:43
    关注

    1./part6/doupload.jsp:24

    2.SMARTUPLOAD 出现java.lang.NegativeArraySizeException解决办法
    Thrown if an application tries to create an array with negative size.

    一般用于表单提交时候,用post来提交,用get就会出现这个异常

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用