求助jspsmartupload组件的使用
本人使用jspsmartupload组件+tomcat5.5+eclipse3.2开发文件上传的jsp网页其代码如下
<%@ page contentType= "text/html;charset=gbk " language= "java " import= "java.util.*,com.jspsmart.upload.* "
errorPage= " "%>
<html>
<head>
<title> 文件上传处理页面 </title>
<meta http-equiv= "Content-Type " content= "text/html;charset=gbk ">
</head>
<body>
<p align= "center ">
<%
SmartUpload su=new SmartUpload();
su.initialize(pageContext);
su.setMaxFileSize(10000);
su.setTotalMaxFileSize(20000);
su.setAllowedFilesList( "doc,txt ");
su.setDeniedFileList( "exe,bat,jsp,html,htm,, ");
su.upload();
int count=su.save( "D:/jsptest/321 ");
out.println(count+ "个文件上传成功! <br> ");
for(int i=0;i <su.getFiles().getCount();i++)
{
com.jspsmart.upload.File file=su.getFiles().getFile(i);
if (file.isMissing()) continue;
out.println( " <TABLE BORDER=1> ");
out.println( " <tr> <td> 表单项名(fieldname) </td> <td> "+file.getFileldName()+ " </td> </tr> ");
out.println( " <tr> <td> 文件长度(size) </td> <td> "+file.getSize()+ " </td> </tr> ");
out.println( " <tr> <td> 文件名(filename) </td> <td> "+file.getFileName()+ " </td> </tr> ");
out.println( " <tr> <td> 文件扩展名(fileext) </td> <td> "+file.getFileExt()+ " </td> </tr> ");
out.println( " <tr> <td> 文件全名(filepathname) </td> <td> "+file.getFilePathName()+ " </td> </tr> ");
out.println( " </TABLE> <BR> ");
}
%>
</p>
</body>
</html>
但在代码的com.jspsmart及SmartUpload的下面有红色的波纹线并的测试的网页中出现以下的错吾
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 9 in the jsp file: /shen.jsp
Generated servlet error:
The method setDeniedFileList(String) is undefined for the type SmartUpload
An error occurred at line: 9 in the jsp file: /shen.jsp
Generated servlet error:
The method getFileldName() is undefined for the type File
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper