版本1.17
框架
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<frameset cols="150,*" frameborder="yes" border="1" framespacing="0" style="position:absolute; top:0; left:0;" id="portalFrm" name="portalFrm">
<frame src="left.jsp" name="leftFrame" scrolling="no" noresize>//左面显示xtree树
<frame src="right.jsp" name="rightFrame" scrolling="no" noresize> //右面显示响应内容
</frameset>
<noframes><body>
</body></noframes>
</html>
左边frame----xtree树形目录left.jsp
<%@ page language="java" pageEncoding="gbk"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>首页</title>
<script src="xtree.js"></script>
<!-- Modify this file to change the way the tree looks -->
<link type="text/css" rel="stylesheet" href="xtree.css">
<style>
body { background: white; color: black; }
input { width: 120px; }
</style>
<script>
function father_location(subframe,locate)//将右边的frame显示为响应内容
{
parent.frames[subframe].location=locate;
}
</script>
</head>
<body>
<script type="text/javascript">
var tree = new WebFXTree('my系统');//根
var p_000=new WebFXTreeItem('工作调度');//一级目录
p_000.action='javascript:p_000.toggle()'; //WebFXTreeItem对象有一个toggle()函数,可以控制目录的展开和关闭
var p_001=new WebFXTreeItem('作业管理');//二级目录
p_001.action="javascript:father_location('rightFrame','<%=request.getContextPath()%>/job/jobview.action')";//WebFXTreeItem对象的action属性可以指定要链接到的url
var p_002=new WebFXTreeItem('调度管理');//二级目录
p_002.action="javascript:father_location('rightFrame','<%=request.getContextPath()%>/scheduler/schedule.jsp')";
p_000.add(p_001);//将将二级目录填入一级目录
p_000.add(p_002);//将将二级目录填入一级目录
var p_010=new WebFXTreeItem('ajax');//一级目录
p_010.action='javascript:p_010.toggle()';
var p_011=new WebFXTreeItem('动态列表');//二级目录
p_011.action="javascript:father_location('rightFrame','<%=request.getContextPath()%>/ajax/dynamiclists.jsp')";
var p_012=new WebFXTreeItem('访问web服务');//二级目录
p_012.action="javascript:father_location('rightFrame','<%=request.getContextPath()%>/ajax/websearch.jsp')";
p_010.add(p_011);//将将二级目录填入一级目录
p_010.add(p_012);//将将二级目录填入一级目录
tree.add(p_000);//将将一级目录填入根
tree.add(p_010);//将将一级目录填入根
document.write(tree);//最后,用document.write(根对象);写到页面显示
</script>
</body>
</html>
最后效果: