用jspsmartupload组件上传文档遇到的错误,高手来!!!!急!!!!!
错误如下:exceptionorg.apache.jasper.JasperException:java.lang.IllegalArgumentException:Th...
错误如下:
exception
org.apache.jasper.JasperException: java.lang.IllegalArgumentException: This path does not exist (1135).
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:532)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:426)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.IllegalArgumentException: This path does not exist (1135).
com.jspsmart.upload.SmartUpload.getPhysicalPath(SmartUpload.java:1089)
com.jspsmart.upload.File.saveAs(File.java:91)
com.jspsmart.upload.File.saveAs(File.java:65)
org.apache.jsp.teacher.uploadhomework_jsp._jspService(uploadhomework_jsp.java:92)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
源代码:
<%@page contentType="text/html;charset=gb2312"
language="java"
import="com.jspsmart.upload.*,grad.util.homework.*;"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<link href="/netteaching/style.css" rel="stylesheet" type="text/css">
<HTML>
<BODY >
<H1>文件上传JSP</H1>
<HR>
<%
int count=0;
String destination="/netteaching/xxMMyyyiii/ssssiiiooXx/oooiiukSw/";
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
op_homework opr=new op_homework();
homework rs=new homework();
String content = mySmartUpload.getRequest().getParameter("title");
String csid=mySmartUpload.getRequest().getParameter("csid");
String type=mySmartUpload.getRequest().getParameter("type");
out.println(content);
for (int i=0;i<mySmartUpload.getFiles().getCount();i++){
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i);
if (!myFile.isMissing()){
myFile.saveAs(destination+ grad.util.DataFormate.toUtf8String(myFile.getFileName()));
out.println("文件大小= " + myFile.getSize() + "<BR>");
out.println("文件名称= " + myFile.getFileName() + "<BR>");
out.println("文件路径名= " + myFile.getFilePathName() + "<BR>");
out.println("文件类型= " + myFile.getContentType() + "<BR>");
count++;
homework ni=new homework();
ni.settitle(content);
ni.setlink(myFile.getFileName());
ni.settype(type);
ni.setstatus("1");
ni.setcourse_code(csid);
opr.addHomework(ni);
}
}
out.println("<BR>可以上传" + mySmartUpload.getFiles().getCount() + "个文件<BR>");
out.println(count + "个文件已经被上传<br>");
out.println("<a href="+"labManage.jsp"+">返回</a>");
%>
</BODY>
</HTML> 展开
exception
org.apache.jasper.JasperException: java.lang.IllegalArgumentException: This path does not exist (1135).
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:532)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:426)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.IllegalArgumentException: This path does not exist (1135).
com.jspsmart.upload.SmartUpload.getPhysicalPath(SmartUpload.java:1089)
com.jspsmart.upload.File.saveAs(File.java:91)
com.jspsmart.upload.File.saveAs(File.java:65)
org.apache.jsp.teacher.uploadhomework_jsp._jspService(uploadhomework_jsp.java:92)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
源代码:
<%@page contentType="text/html;charset=gb2312"
language="java"
import="com.jspsmart.upload.*,grad.util.homework.*;"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<link href="/netteaching/style.css" rel="stylesheet" type="text/css">
<HTML>
<BODY >
<H1>文件上传JSP</H1>
<HR>
<%
int count=0;
String destination="/netteaching/xxMMyyyiii/ssssiiiooXx/oooiiukSw/";
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
op_homework opr=new op_homework();
homework rs=new homework();
String content = mySmartUpload.getRequest().getParameter("title");
String csid=mySmartUpload.getRequest().getParameter("csid");
String type=mySmartUpload.getRequest().getParameter("type");
out.println(content);
for (int i=0;i<mySmartUpload.getFiles().getCount();i++){
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i);
if (!myFile.isMissing()){
myFile.saveAs(destination+ grad.util.DataFormate.toUtf8String(myFile.getFileName()));
out.println("文件大小= " + myFile.getSize() + "<BR>");
out.println("文件名称= " + myFile.getFileName() + "<BR>");
out.println("文件路径名= " + myFile.getFilePathName() + "<BR>");
out.println("文件类型= " + myFile.getContentType() + "<BR>");
count++;
homework ni=new homework();
ni.settitle(content);
ni.setlink(myFile.getFileName());
ni.settype(type);
ni.setstatus("1");
ni.setcourse_code(csid);
opr.addHomework(ni);
}
}
out.println("<BR>可以上传" + mySmartUpload.getFiles().getCount() + "个文件<BR>");
out.println(count + "个文件已经被上传<br>");
out.println("<a href="+"labManage.jsp"+">返回</a>");
%>
</BODY>
</HTML> 展开
2个回答
展开全部
This path does not exist
如果你的工程名是netteaching的话,改下destination;
String destination="xxMMyyyiii/ssssiiiooXx/oooiiukSw/";
myFile.saveAs(request.getRealPath("/")destination+ grad.util.DataFormate.toUtf8String(myFile.getFileName()));
如果你的工程名是netteaching的话,改下destination;
String destination="xxMMyyyiii/ssssiiiooXx/oooiiukSw/";
myFile.saveAs(request.getRealPath("/")destination+ grad.util.DataFormate.toUtf8String(myFile.getFileName()));
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询