高手:jspsmartupload出错.请提示.

chenfei00 2003-11-26 11:50:17
500 Servlet Exception
java.lang.NegativeArraySizeException
at com.jspsmart.upload.SmartUpload.upload(SmartUpload.java:218)
at _sample5__jsp._jspService(/sample5.jsp:21)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.pageservice(Page.java:549)
at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:184)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:149)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:257)
at com.caucho.server.port.WorkerThread.run(WorkerThread.java:123)
at java.lang.Thread.run(Thread.java:536)


sample5.jsp文件是smartupload自带的DEMO.
...全文
80 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenfei00 2003-11-26
  • 打赏
  • 举报
回复
小弟用的是Resin3.0 主目录文件列表如下.
│ sample1.jsp
│ sample2.jsp
│ sample3.jsp
│ sample4.jsp
│ sample5.jsp
│ sample6.jsp
│ sample7.jsp

└─WEB-INF
├─classes
│ │ servletUpload.class
│ │ servletUpload.java
│ │
│ └─com
│ └─jspsmart
│ └─upload
│ File.class
│ Files.class
│ Request.class
│ SmartUpload.class
│ SmartUploadException.class

├─work
│ _sample1__jsp.java
│ _sample1__jsp.java.smap
│ _sample1__jsp.class

└─tmp
chenfei00 2003-11-26
  • 打赏
  • 举报
回复
sample5.jsp文件是smartupload自带的DEMO.源码如下:
<%@ page language="java" import="com.jspsmart.upload.*"%>
<jsp:useBean id="myUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />

<HTML>
<BODY BGCOLOR="white">

<H1>jspSmartUpload : Sample 5</H1>
<HR>

<%

myUpload.initialize(pageContext);
myUpload.upload();
out.println("<BR><STRONG>Display information about Files</STRONG><BR>");
out.println("Number of files = " + myUpload.getFiles().getCount() + "<BR>");
for (int i=0;i<myUpload.getFiles().getCount();i++){

out.print(myUpload.getFiles().getFile(i).getFieldName());
if (!myUpload.getFiles().getFile(i).isMissing())
out.print(" = " + myUpload.getFiles().getFile(i).getFileName() + " (" + myUpload.getFiles().getFile(i).getSize() + ")");
else
out.print(" = vide");
out.println("<BR>");
}
out.println("<BR><BR><STRONG>Display information about Requests</STRONG><BR>");
java.util.Enumeration e = myUpload.getRequest().getParameterNames();
while (e.hasMoreElements()) {
String key = (String)e.nextElement();
String[] values = myUpload.getRequest().getParameterValues(key);
for(int i = 0; i < values.length; i++) {
out.print(key + " = ");
out.print(values[i] + "<BR>");
}
}

%>


</BODY>
</HTML>




minimu 2003-11-26
  • 打赏
  • 举报
回复
_sample5__jsp._jspService(/sample5.jsp:21)
到work目录看看编译出来的文件就清楚了啊

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧