-
Notifications
You must be signed in to change notification settings - Fork 0
/
aaa.jsp
47 lines (39 loc) · 1.47 KB
/
aaa.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<%@page import="java.io.FileFilter"%>
<%@page import="java.util.Arrays"%>
<%@page import="java.io.File"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>成都博为峰</title>
</head>
<body>
<span>
<h1>hello, 博为峰的小伙伴们,这是公司新购的阿里云web服务器的根路径。</h1>
<strong><h2 style="color:red">云服务器是按流量计费的,每小时上传下载总流量不能超过100M,因此,请不要上传大文件哟!</h2><strong>
<h2>目前有3个课程: <span style="background-color:#ccc">course</span>、<span style="background-color:#ccc">j2ee_lgm</span>和<span style="background-color:#ccc">Jsp/Servlet示例</span></h2>
<h2>如果需要新增课程,请新建一个目录,并把访问入口以相对路径方式加到此页面,谢谢!~good luck</h2>
</span>
--------------------------------------------------------------------------------
<span>
<h3>以下链接指向课程:</h3>
<%
String path = application.getRealPath("/");
File pathFile = new File(path);
File[] dirs = pathFile.listFiles(new FileFilter(){
public boolean accept(File f) {
return f.isDirectory() && !f.getName().startsWith(".");
}
});
for(File dir : dirs){
String f = dir.getName();
if(f.equals("bms")) {
f += "/main.html";
}
out.print("<h3><a href= \""+f+"\">"+f+"</a></h3>");
}
%>
</span>
</body>
</html>