<%@ page language="java" contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.Connection,com.data.DBConnect"%>
<html>
<head>
<title>网站结构</title>
<style type="text/css">
<!--
.txt1 {
font-size: 9pt;
color: #000000;
text-decoration: none;
}
.txt2 {
font-size: 9pt;
color: #669999;
text-decoration: none;
}
.tr1 {
margin: 0px;
padding: 0px;
border: none;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
clip: rect(0px 0px 0px 0px);
}
-->
</style>
<script language="JScript">
function turnit(ss,ii,aa)
{
if (ss.style.display=="none")
{
ss.style.display="";
ii.src="/tree/t2.gif";
aa.style.display="";
}
else
{
ss.style.display="none";
ii.src="/tree/t1.gif";
aa.style.display="none";
}
}
function maingo(part_id,part_name)
{
parent.mainFrame.location="/part/part_util.jsp?part_id="+part_id;
}
function mainto()
{
parent.mainFrame.location="/part/part_util.jsp?part_id=-1";
}
</script>
</head>
<body onLoad="mainto()">
网站结构
<%
Connection con=new DBConnect().getConn();
request.setAttribute("con",con);
request.setAttribute("part_main_id","-1");
request.getRequestDispatcher("part.jsp").include(request,response);
%>
</body>
</html>
//part.jsp
<%@ page language="java" contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.Connection,com.model.*,com.database.*"%>
<table width="100%" border="0" cellpadding="3" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="tr1">
<%
String part_main_id=(String)request.getAttribute("part_main_id");//?鬣???ID
String imgnum=(String)request.getAttribute("imgstr");
Connection con=(Connection)request.getAttribute("con");
PartDB pd=new PartDB();
String imgstr="";
if(imgnum==null | |imgnum.equals(""))
{
imgstr="";
}
PartVector pv=pd.executeQueryMain(con,part_main_id);
PartModel pm=null;
for(int i=0;i<pv.size();i++)
{
pm=pv.get(i);
String part_id=pm.getPart_id();
String part_name=pm.getPart_name();
String issubschema=pm.getIssubschema();
if(issubschema!=null&&issubschema.equals("0")){//?T左???2 |囗
%>
<tr>
<td height="26" bgcolor="#E1E1E1" class="txt2"><%=imgstr%><img src="/tree/treeimg/dot.gif" width="12" height="12"></td>
<td width="505" bgcolor="#E1E1E1" onClick="maingo('<%=part_id%>','<%=part_name%>')" style="cursor:'hand'"><%=part_name%></td>
</tr>
<%}else{//驞左???2 |囗
String content1="content"+part_id;
String img1="img"+part_id;
String aux1="aux"+part_id;%>
<tr>
<td height="26" bgcolor="#E1E1E1" class="txt1" style="cursor:'hand';" onmouseup="turnit(<%=content1%>,<%=img1%>,<%=aux1%>);" language="JScript">
<%=imgstr%><img src="/tree/t1.gif" width="12" height="12" ID="<%=img1%>">
</td>
<td bgcolor="#E1E1E1" onClick="maingo('<%=part_id%>','<%=part_name%>')" style="cursor:'hand'"><%=part_name%></td>
</tr>
<tr>
<td width="22" height="26" bgcolor="#E1E1E1" class="tr1" ID="<%=aux1%>" STYLE="Display:'none';">
</td>
<td bgcolor="#E1E1E1" ID="<%=content1%>" STYLE="Display:'none';">
<%
request.setAttribute("con",con);
request.setAttribute("imgstr","1");
request.setAttribute("part_main_id",part_id);
request.getRequestDispatcher("/tree/part.jsp") .include(request,response);
%>
</td>
</tr>
<%}
}
%>
</table>
<%@ page import="java.sql.Connection,com.data.DBConnect"%>
<html>
<head>
<title>网站结构</title>
<style type="text/css">
<!--
.txt1 {
font-size: 9pt;
color: #000000;
text-decoration: none;
}
.txt2 {
font-size: 9pt;
color: #669999;
text-decoration: none;
}
.tr1 {
margin: 0px;
padding: 0px;
border: none;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
clip: rect(0px 0px 0px 0px);
}
-->
</style>
<script language="JScript">
function turnit(ss,ii,aa)
{
if (ss.style.display=="none")
{
ss.style.display="";
ii.src="/tree/t2.gif";
aa.style.display="";
}
else
{
ss.style.display="none";
ii.src="/tree/t1.gif";
aa.style.display="none";
}
}
function maingo(part_id,part_name)
{
parent.mainFrame.location="/part/part_util.jsp?part_id="+part_id;
}
function mainto()
{
parent.mainFrame.location="/part/part_util.jsp?part_id=-1";
}
</script>
</head>
<body onLoad="mainto()">
网站结构
<%
Connection con=new DBConnect().getConn();
request.setAttribute("con",con);
request.setAttribute("part_main_id","-1");
request.getRequestDispatcher("part.jsp").include(request,response);
%>
</body>
</html>
//part.jsp
<%@ page language="java" contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.Connection,com.model.*,com.database.*"%>
<table width="100%" border="0" cellpadding="3" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="tr1">
<%
String part_main_id=(String)request.getAttribute("part_main_id");//?鬣???ID
String imgnum=(String)request.getAttribute("imgstr");
Connection con=(Connection)request.getAttribute("con");
PartDB pd=new PartDB();
String imgstr="";
if(imgnum==null | |imgnum.equals(""))
{
imgstr="";
}
PartVector pv=pd.executeQueryMain(con,part_main_id);
PartModel pm=null;
for(int i=0;i<pv.size();i++)
{
pm=pv.get(i);
String part_id=pm.getPart_id();
String part_name=pm.getPart_name();
String issubschema=pm.getIssubschema();
if(issubschema!=null&&issubschema.equals("0")){//?T左???2 |囗
%>
<tr>
<td height="26" bgcolor="#E1E1E1" class="txt2"><%=imgstr%><img src="/tree/treeimg/dot.gif" width="12" height="12"></td>
<td width="505" bgcolor="#E1E1E1" onClick="maingo('<%=part_id%>','<%=part_name%>')" style="cursor:'hand'"><%=part_name%></td>
</tr>
<%}else{//驞左???2 |囗
String content1="content"+part_id;
String img1="img"+part_id;
String aux1="aux"+part_id;%>
<tr>
<td height="26" bgcolor="#E1E1E1" class="txt1" style="cursor:'hand';" onmouseup="turnit(<%=content1%>,<%=img1%>,<%=aux1%>);" language="JScript">
<%=imgstr%><img src="/tree/t1.gif" width="12" height="12" ID="<%=img1%>">
</td>
<td bgcolor="#E1E1E1" onClick="maingo('<%=part_id%>','<%=part_name%>')" style="cursor:'hand'"><%=part_name%></td>
</tr>
<tr>
<td width="22" height="26" bgcolor="#E1E1E1" class="tr1" ID="<%=aux1%>" STYLE="Display:'none';">
</td>
<td bgcolor="#E1E1E1" ID="<%=content1%>" STYLE="Display:'none';">
<%
request.setAttribute("con",con);
request.setAttribute("imgstr","1");
request.setAttribute("part_main_id",part_id);
request.getRequestDispatcher("/tree/part.jsp") .include(request,response);
%>
</td>
</tr>
<%}
}
%>
</table>
解决方案 »
- Servlet.service() for servlet jsp threw exception
- servlet 连接mysql数据库时出现错误,麻烦高手帮看看
- 求JAVA Webservice教程
- 如何获得用户所选的下拉列表的值,并从数据库提取数据显示在另外一个下拉列表中(在同一个页面实现)
- 如何取得事件函数的源代码
- 能提供一下新闻点击数统计实现想法吗?根据会话统计
- 急!!!!请问谁知道eclipse3.1中如何显示空格和制表符啊
- linux 下用renameTo方法无法修改文件夹路径
- 在<body>里执行一个js函数?怎样做?很简单,马上给分
- tomcat关闭时遇到的关于shiro警告
- 哪位前辈去sohu面试过,请指教一下.
- 为什么我的IE6显示不了Applet程序阿?
[email protected]
看我的DTREE配合JSP,DTREE的主要JS文件可以在网上找啦~~~<script language="javascript">
<!-- d = new dTree('d'); d.add(0,-1,'山东省地方志联合数据库');
<%Vector areas=(Vector)request.getAttribute("areas");
if(areas!=null){
for(int i=0;i<areas.size();i++){
Area area=(Area)areas.elementAt(i);
%>
d.add(<%=area.getId()%>,<%=area.getParentid()%>,'<%=area.getArea_name()%>','');
<%}}%>
d.add(12,0,'综合查询','/servlet/Cho?req=showsearch','','mainFrame','/chorography/images/tree/globe.gif');
d.add(13,0,'系统管理','/servlet/Cho?req=showadmin','','mainFrame','/chorography/images/tree/base.gif'); document.write(d); //-->
</script>
方便的话给我发一个,thanks
[email protected]
给俺发一个把
学习学习
[email protected]
fason.nease.net
可以参考着改
[email protected]
msn:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]