07_03.jsp

来自「jsp数据库编程入门」· JSP 代码 · 共 35 行

JSP
35
字号
<html>
<head>
<title>新建文件或目录</title>
</head>
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="java.io.File"%>
<jsp:useBean id="list" class="test.CatalogOperate" scope="session" />
<body>
<center><h2>
新建文件或目录
</h2></center>
<%
  String path = new String(request.getParameter("path").getBytes("iso8859-1"), "gb2312");
  String type = request.getParameter("type");
  String name = new String(request.getParameter("name").getBytes("iso8859-1"), "gb2312");
  if (type.equals("dir"))
  {
     if (list.newDir(name)==true)
     {%>
	建立目录成功!<br>	
<%   }else{%>
	建立目录失败!<br>	
<%   }
  }else if (type.equals("file"))
  {
      if (list.newFile(name)==true)
      {%>
	建立文件成功!<br>	
<%    }else{%>
	建立文件失败!<br>	
<%    }
  }%>
<a href=07_02.jsp?path=<%=path%>>返回</a><br>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?