MyEclipse------如何在特定目录下创建文件夹

Directory.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<%@page import="java.io.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'Directory.jsp' starting page</title>
</head> <body>
<%
path=request.getRealPath("")+"\\test";
File d=new File(path);
if(d.exists()){
d.delete();
out.print("test文件夹已经被删除!!!");
}
else{
d.mkdir();
out.print("test文件夹已经被创建!!!");
}
%>
</body>
</html>
上一篇:《javascript高级程序设计》第21章 Ajax和Comet


下一篇:批处理与python代码混合编程的实现方法