高手: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.
...全文
20 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过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目录看看编译出来的文件就清楚了啊
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2003-11-26 11:50
社区公告
暂无公告