⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 left.jsp

📁 一个简单的二级树型目录的代码.用户可以将left.jsp中的代码根据你自己的需求,进行修改.
💻 JSP
字号:
<%@page contentType ="text/html;charset=gb2312" import="com.cmesn.struts.action.left_list,java.sql.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">

</style></head>
<body>
<script language="javascript">
	
	function ShowTR(objImg,objTr){
		if(objTr.style.display==""){
			objTr.style.display="none";
			objImg.src="../img/jia.gif";
			objImg.alt="展开";
		}else{
			objTr.style.display="";
			objImg.src="../img/jian.gif";
			objImg.alt="折叠";
		}
	}
</script>
<%
	left_list conn = new left_list();
	ResultSet rs_superType = conn.check("select * from cmesn_sort where bigsort_id=0 group by Sort_id,Sort order by Sort desc ");
%>
<table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
<%
	int ID_superType =0;//获取ID
	String superType= "";//获取分模块
	int m=1;
	while(rs_superType.next()){
		ID_superType =rs_superType.getInt(1);//获取ID编号
		superType =rs_superType.getString(2);//获取模块
				String sql ="select * from cmesn_sort where bigsort_id="+ID_superType;//获取相同ID,并把相同ID放在一个模块里面
				ResultSet rs_subType=conn.check(sql);
				String subType="";
				int subID=0;
				//获取记录数
				rs_subType.last();
				int subType_RC=rs_subType.getRow();
				rs_subType.first();
%>
<tr>
<td><%if(subType_RC<=0){%>
	&nbsp;&nbsp;&nbsp;&nbsp;
<img src="../img/jian_null.gif" width="16" height="20" border="0"><font size="3"><%=superType%></font>
	<%}else{%>
	&nbsp;&nbsp;
	<a href="Javascript:ShowTR(img<%=m%>,OpenRep<%=m%>)"><img src="../img/jia.gif"
	 border="0" alt="展开" id="img<%=m%>"></a>
	 <font size="2.5"><%=superType%></font>
	 <%}%></td>
	 <%if(subType_RC>0){%>
	<tr id="OpenRep<%=m%>" style="display:none;">
		<td colspan="6"><%do{
								subType=rs_subType.getString(2);
								subID=rs_subType.getInt(1);

								%>
		<table width="100%" border="0" cellspacing="-2" cellpadding="-2">
			<tr>
				<td height="25" align="center"><table width="90%" cellspacing="0" border="0"  cellspacing="0" cellpadding="0">
					<tr onMouseOver="this.style.background='#EEEEEE'" 
						onmouseout="this.style.background=''">
					<td width="15%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
					<td width="10%" align="center"><img src="../img/folder.gif" width="16" 
						height="16" border="0"></td>	
					<td width="75%"><a href="../left.do?Type=<%=subID%>" target ="right"><%=subType%></a></td>
			</tr>
		</table></td>
	</tr>
	</table>
	<% m++;
	}while(rs_subType.next());%></td>
	<%}%>
	</tr>
	<%}%>
	</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -