In servlet,you also can find doDelete method implement of the httpservlet interface. But I never use,you may try as that.Before you use f.delete(),pls while f.isFile(),f.exist() to judge the file existing or not.
我代码和错误如下: 确定c:\test.txt 存在。 这是什么原因啊? ------------------------------------------------ <%@ page contentType="text/html;charset=gb2312"%> <%@ page language="java" import="com.jspsmart.upload.*"%> <jsp:useBean id="myUpload" scope="page" class="com.jspsmart.upload.SmartUpload" /> <% File f = new File("c:\test.txt"); //f.delete(); %> ------------------------------------ 500 Servlet Exception Note: sun.tools.javac.Main has been deprecated. /well-being/2222222editor/save.jsp:21: Wrong number of arguments in constructor. Files fff =new File("c:\test.txt"); ^ 1 error, 1 warning
But I never use,you may try as that.Before you use f.delete(),pls while f.isFile(),f.exist() to judge the file existing or not.
------------------------------------------------
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page language="java" import="com.jspsmart.upload.*"%>
<jsp:useBean id="myUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<%
File f = new File("c:\test.txt");
//f.delete();
%>
------------------------------------
500 Servlet Exception
Note: sun.tools.javac.Main has been deprecated.
/well-being/2222222editor/save.jsp:21: Wrong number of arguments in constructor.
Files fff =new File("c:\test.txt");
^
1 error, 1 warning
why Files???