为何还出错?
我下载了smartupload包
然后添加到了classpath里和WEB-INF里的lib下了,不过在使用里还出错
我的代码是:
<%@ page contentType= "text/html;charset=gb2312 " %>
<%@ page import= "com.jspsmart.upload.* " %>
<html>
<head>
<title> uplaod </title>
</head>
<body>
<%
SmartUpload su=new SmartUpload();
su.initialize(pageContext);
su.setMaxFileSize(200*1024*1024);
su.upload();
for(int i=0;i <su.getFiles().getCount();i++){
com.jspsmart.upload.File file=su.getFiles().getFile(i);
if(!file.isMissing()){
String tfilename=file.getFileName();
String suffix=tfilename.substring(0,tfilename.lastIndexOf( '. '));
String ext=su.getFiles().getFile(0).getFileExt();
int filesize=file.getSize();
String savepath=getServletContext().getRealPath( "/ ")+ "upload\\ ";
String trace=savepath+tfilename;
file.saveAs(savepath,Save_PHYSICAL);
}
}
out.println( "upload ");
%>
</body>
</html>
错误信息是:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 8 in the jsp file: /upload.jsp
Generated servlet error:
SmartUpload cannot be resolved to a type
An error occurred at line: 8 in the jsp file: /upload.jsp
Generated servlet error:
SmartUpload cannot be resolved to a type
An error occurred at line: 8 in the jsp file: /upload.jsp
Generated servlet error:
com.jspsmart.upload.File cannot be resolved to a type
An error occurred at line: 8 in the jsp file: /upload.jsp
Generated servlet error:
Save_PHYSICAL cannot be resolved
smartupload我都添加了,还说找不到类型.我真不知道怎么办了.各位帮帮忙..
[解决办法]
不要用包,用它的CLASS文件好了,把CLASS文件放到你的CLASSES下
[解决办法]
楼上正解
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.myexception.cn/j2ee/2308.html