jsp使用jspSmartUpload编写下载时出现路径不正确
<title>下载页面</title><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><...
<title>下载页面</title><meta http-equiv="Content-Type" content="text/html;charset=gb2312"></head><body> <% SmartUpload su=new SmartUpload(); su.initialize(pageContext); su.setContentDisposition(null); su.downloadFile("upload/daomubiji.txt"); %></body></html>
出现的错误:
org.apache.jasper.JasperException: An exception occurred processing JSP page /yanruyu1/1/xiazai.jsp at line 12
9: SmartUpload su=new SmartUpload();
10: su.initialize(pageContext);
11: su.setContentDisposition(null);
12: su.downloadFile("upload/daomubiji.txt");
13: %>
14: </body>
15: </html>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:423)
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.io.FileNotFoundException: upload\daomubiji.txt (系统找不到指定的路径。)
java.io.FileInputStream.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:120)
com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:545)
com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:508)
com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:476)
org.apache.jsp.yanruyu1._1.xiazai_jsp._jspService(xiazai_jsp.java:66)
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:393)
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) 展开
出现的错误:
org.apache.jasper.JasperException: An exception occurred processing JSP page /yanruyu1/1/xiazai.jsp at line 12
9: SmartUpload su=new SmartUpload();
10: su.initialize(pageContext);
11: su.setContentDisposition(null);
12: su.downloadFile("upload/daomubiji.txt");
13: %>
14: </body>
15: </html>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:423)
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.io.FileNotFoundException: upload\daomubiji.txt (系统找不到指定的路径。)
java.io.FileInputStream.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:120)
com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:545)
com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:508)
com.jspsmart.upload.SmartUpload.downloadFile(SmartUpload.java:476)
org.apache.jsp.yanruyu1._1.xiazai_jsp._jspService(xiazai_jsp.java:66)
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:393)
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) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询