<%@ page import = “SQLDATA” %> <p align=”center”><font size=”6″ face=”楷体_GB2312″>毛泽东思想概论</font></p> } 转:http://www.cnjsp.org
<%@ page import=”java.sql.*” %>
<%@ page contentType=”text/html;charset=gb2312″ %>
<jsp:useBean id=”sqlbean” class=”SQLDATA” scope=”session”/>
<html>
<body background=”../images/back.jpg”>
<%
String aa,bb,cc,dd,ee,ff;
ResultSet rs=sqlbean.executeQuery(“SELECT * FROM MAOGAI”);
int i=1,j=0;
while(rs.next())
{
aa=rs.getString(“SECTIONTYPE”);
bb=rs.getString(“SECTIONNAME”);
cc=rs.getString(“INDEXFILE”);
ee=rs.getString(“ZIPFILE”);
ff=rs.getString(“ONLINEFILE”);
dd=rs.getString(“SESSIONID”);
if(aa.indexOf(章)>-1)
{
if(j==1)
{
i=i+1;
out.println(“</table></div>”);
}
j=0;
out.println(” “);
out.println(“<div align=center>”);
out.println(“<center>”);
out.println(“<table border=0 width=90% height=0 cellspacing=0 cellpadding=0>”);
out.println(“<tr>”);
out.println(“<td height=0><img name=img”+String.valueOf(i)+” border=0 src=../images/fclosed.gif onclick=ShowAndHide(div”+String.valueOf(i)+”,”+”img”+String.valueOf(i)+”)>”);
out.print(bb+”</td></tr></table></center></div>”);
}
else
{
if(j==0)
{
j=1;
out.println(“<div style=display:none id=div”+String.valueOf(i)+” align=center>”);
out.println(“<center>”);
out.println(“<table border=0 width=90% height=0 cellspacing=0 cellpadding=0>”);
out.println(“<tr><td height=30> <img border=0 src=../images/file.gif>”);
out.print(“<a href=windowsopen.jsp?indexfile=maogai/”+cc+”&sessionid=”+dd+”&zipfile=”+ee+”&onlinefile=”+ff+”>”+bb+”</a></td></tr>”);
}
else
{
out.println(“<tr><td height=30> <img border=0 src=../images/file.gif>”);
out.print(“<a href=windowsopen.jsp?indexfile=maogai/”+cc+”&sessionid=”+dd+”&zipfile=”+ee+”&onlinefile=”+ff+”>”+bb+”</a></td></tr>”);
}
}
%>
</body>
</html>
<script language=javascript>
function ShowAndHide(divname,imgname)
{
if (divname.style.display == “block”)
{
divname.style.display = “none”;
imgname.src=”http://www.knowsky.com/../images/fclosed.gif”;
self.focus();
}
else
{
divname.style.display = “block”;
imgname.src=”http://www.knowsky.com/../images/fopen.gif”;
self.focus();
}
}
</script>
用jsp实现类似资源管理器式的文件与目录的折叠(代码示例)_jsp技巧
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 用jsp实现类似资源管理器式的文件与目录的折叠(代码示例)_jsp技巧
相关推荐
-      通过jdbc连接oracle的十大灵活技术_jsp技巧
-      jdbc之代码重复使用_jsp技巧
-      提升jsp页面响应速度的七大秘籍绝招_jsp技巧
-      jdbc连sql server数据库步骤及有一项操作已被挂起,需重新启动计算机解决办法_jsp技巧
-      解决jsp中使用request乱码问题_jsp技巧
-      详细的jsp分页(oracle+jsp+apache)_jsp技巧
-      jsp中与标签要用不同的方式获得数据库中的数据_jsp技巧
-      jsp2.0新特性_jsp文摘