<%@  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>  

解决方案 »

  1.   

    我这儿有的,留下你的QQ或MSN ,我给你发一个!
      

  2.   

    如果方便的话,我也要一份
    [email protected]
      

  3.   

    用DTREE不是很好吗???
    看我的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>
      

  4.   

    To seaman0916(沙漠孤鹰) 
     方便的话给我发一个,thanks
    [email protected]
      

  5.   

    偶也需要
    给俺发一个把
    学习学习
    [email protected]
      

  6.   

    请你也给我一份,好吗,现在我正需要jsp的树型菜单,学习中.....我的msn是[email protected]
      

  7.   

    访问
    fason.nease.net
    可以参考着改
      

  8.   

    发一份可以吗。我正为这事发愁呢[email protected]
      

  9.   

    deeptree和CSTreeBean(从数据库中提取),你自己看看那个合适
      

  10.   

    发一份可以吗。谢谢!
    [email protected]
      

  11.   

    我有,可以联系
    msn:
    [email protected]
      

  12.   

    发一份可以吗。谢谢!
    [email protected]
      

  13.   

    发一份可以吗。谢谢!
    [email protected]
      

  14.   

    还有我:
      [email protected]
      

  15.   

    还有 偶 偶 偶
    [email protected]
      

  16.   

    强烈推荐fason.nease.net的树,用了感觉还不错