新建一个web工程
需要一个index.jsp放在webroot下,一个dtree.js放在webroot下的js(自己new的Folder)里,一个dtree.css放在webroot下的css(自己new的Folder)里,一个img(自己new的Folder)
代码如下
index.jsp
<%@ page language="java" import="java.util.*"pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath =request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01Transitional//EN">
<html>
<head>
<meta http-equiv="pragma"content="no-cache">
<meta http-equiv="cache-control"content="no-cache">
<meta http-equiv="expires"content="0">
<meta http-equiv="keywords"content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is mypage">
<link rel="stylesheet" type="text/css"href="css/dtree.css">
<script type="text/javascript"src="js/dtree.js"></script>
</head>
<body>
<div class="dtree">
<p><ahref="javascript:d.openAll();">展开</a> |<a href="javascript:d.closeAll();">收缩</a></p>
<script type="text/javascript">
</script>
</div>
</body>
</html>