left.jsp(左框架树形结构)
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*"%>
<%@ page import="com.struts.domain.*"%>
<%
request.setCharacterEncoding("gb2312");
%>
<%
User user= (User)session.getAttribute("userInfo");
HashMap hashMap=(HashMap)session.getAttribute("hashMap");//request.getAttribute("hashMap");
List module=(List)hashMap.get("module");
ArrayList rootNode=new ArrayList();
for(int i=0;i<module.size();i++){
Module moduleDataInfo=(Module) module.get(i);
if(moduleDataInfo.getModuleId().toString().equals(moduleDataInfo.getModuleNodeId())){
rootNode.add(moduleDataInfo);
}
}
%>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title></title>
<style type="text/css">
body {
background: #6295cc;
margin: 0px;
font: 12pt 宋体;
scrollbar-face-color: #b0d7f6;
scrollbar-highlight-color: #ffffff;
scrollbar-shadow-color: #284b9a;
scrollbar-3dlight-color: #284b9a;
scrollbar-arrow-color: #70068e;
scrollbar-track-color: #e2f3f1;
scrollbar-darkshadow-color: #ffffff;
text-decoration: none;
overflow-x: hidden;
}
table {
border-right: 0px;
border-top: 0px;
border-left: 0px;
border-bottom: 0px
}
td {
font: 12px 宋体;
}
img {
border-right: 0px;
border-top: 0px;
vertical-align: bottom;
border-left: 0px;
border-bottom: 0px
}
a {
color: #215dc6;
text-decoration: none
}
a:hover {
color: #cc0000;
text-decoration: underline;
}
.sec_menu {
border-right: white 2px solid;
background: #eef7ff; overflow: hidden;
border-left: white 2px solid;
border-bottom: white 2px solid;
}
.menu_title {
}
.menu_title span {
font-weight: bold;
left: 8px;
color: #215dc6;
position: relative;
top: 2px
}
.menu_title2 {
}
.menu_title2 span {
font-weight: bold;
left: 8px;
color: #215dc6;
position: relative;
top: 2px
}
.style2 {
}
.showimg {
background-image:url(images/b2x.jpg);
}
.hideimg {
background-image:url(images/b2s.jpg);
}
</style>
<script type="text/javascript" src="js/wans01.js"></script>
<script type="text/javascript" src="js/wans02.js"></script>
<script language="javascript1.2">
function showsubmenu(sid) {
whichel = eval("submenu" + sid);
if (whichel.style.display == "none"){
eval("submenu" + sid + ".style.display=/"/";");
$('#submenu' + sid).fadeIn("slow");
document.getElementById("menutitle" + sid).setAttribute('background', 'images/b2s.jpg');
}else{
eval("submenu" + sid + ".style.display=/"none/";");
document.getElementById("menutitle" + sid).setAttribute('background', 'images/b2x.jpg');
}
}
function showhideAll(){
var menutitle_array = ['1', '2', '3', '4'];
menutitleCount = menutitle_array.length
if (document.getElementById("picAll").title == "折叠所有模块") {
for (var i = 0; i < menutitleCount; i++) {
document.getElementById("picAll").setAttribute('title', "展开所有模块");
eval("submenu" + menutitle_array[i] + ".style.display=/"none/";");
document.getElementById("menutitle" + menutitle_array[i]).setAttribute('background', 'images/b2x.jpg');
}
} else {
for (var i = 0; i < menutitleCount; i++) {
document.getElementById("picAll").setAttribute('title', "折叠所有模块");
eval("submenu" + menutitle_array[i] + ".style.display=/"/";");
$('#submenu' + menutitle_array[i]).fadeIn("slow");
document.getElementById("menutitle" + menutitle_array[i]).setAttribute('background', 'images/b2s.jpg');
}
}
}
window.onload = function(){
//$('#info').fadeIn("slow");
$('#Info_fade').fadeIn("slow");
}
</script>
<meta http-equiv=content-type content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<table cellspacing="0" cellpadding="0" width="100%" align="left" border="0" id="Info_fade">
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" width="158" align="center" border="0">
<tr>
<td valign=bottom height="42"><img height="36" src="images/t2.jpg" width="158" title="展开所有模块" id="picAll" style="cursor: hand" ></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="158" align="center">
<tr>
<td class="menu_title" id="menutitle0" onMouseOver="this.classname='menu_title2';" onMouseOut="this.classname='menu_title';" background="images/b2t.jpg" height="25"><span><a href="/OA/login.jsp" target=_parent><b>重新登陆</b></a> | <a href="loginout.jsp" target=_top><b>退出</b></a></span> </td>
</tr>
<tr>
<td id="submenu0">
<div class="sec_menu" style="width: 158px">
<table cellspacing="0" cellpadding="0" width="130" align="center">
<tr>
<td height="30" valign="bottom"><p> </p>用户名:
<%=user.getUserName()%></td>
</tr>
<tr>
<td height="30">姓 名: <%=user.getUserRealName()%></td>
</tr>
</table>
</div>
<div style="width: 158px">
<table cellspacing="0" cellpadding="0" width="130" align="center">
<tr>
<td height="20"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<%
for (int i=0;i<rootNode.size();i++){
Module moduleData=(Module) rootNode.get(i);
String moduleId=moduleData.getModuleId().toString().trim();
%>
<table cellspacing="0" cellpadding="0" width="158" align="center">
<tr>
<td class="menu_title" id="menutitle3<%=i%>" onMouseOver="this.classname='menu_title2';" style="cursor: hand" onClick="showsubmenu(3<%=i%>)" onMouseOut="this.classname='menu_title';" background="images/b2x.jpg" height="25"><span><%out.print(moduleData.getModuleName());%></span></td>
</tr>
<tr>
<td id="submenu3<%=i%>" style="display: none">
<div class="sec_menu" style="width: 158px">
<table cellspacing="0" cellpadding="0" width="130" align="center">
<%
for(int j=0;j<module.size();j++){
Module moduleChildData=(Module) module.get(j);
String nodeId=moduleChildData.getModuleNodeId().trim();
String moduleCId=moduleChildData.getModuleId().toString().trim();
if(nodeId.equals(moduleId)&&!nodeId.equals(moduleCId)){
%>
<tr>
<td height="20"><a href="<%=moduleChildData.getModuleUrl()%>" target=mainFrame><%=moduleChildData.getModuleName()%></a></td>
</tr>
<%
}
}
%>
</table>
</div>
<div style="width: 158px">
<table cellspacing="0" cellpadding="0" width="130" align="center">
<tr>
<td height="20"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<%
}
%>
<table cellspacing="0" cellpadding="0" align="center" id="info">
<tr>
<td height="25" background="images/b2++.jpg" class="menu_title" id="menutitle9" onMouseOver="this.classname='menu_title2';" onMouseOut="this.classname='menu_title';"><span>版权信息</span></td>
</tr>
<tr>
<td>
<div class="sec_menu" style="width: 158px">
<table cellspacing="0" cellpadding="0" width=137 align=center>
<tr>
<td height="20">版权:</td>
</tr>
<tr>
<td height=19>版本:v1.0</td>
</tr>
<tr>
<td height=17>日期:2007-7-2</td>
</tr>
<tr>
<td height="20">主页:<a href="." target="_blank">WANS</a></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
login.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户登陆</title>
<style>
*{
margin: 0;
}
body{
font-size: 12px;
background-color: E0E7F1;
}
input{
font-size: 12px;
}
#pwd {
font-family: 宋体
}
.top01{
height: 57px;
background: url(images/top01.jpg) repeat left top;
}
.middle2_1{
height: 393px;
background: url(images/middle2_1.jpg) repeat left top;
}
.middle03{
height: 60px;
background: url(images/middle03.jpg) repeat left top;
}
.bottom01{
height: 90px;
background: url(images/bottom01.jpg) repeat left top;
}
.footer{
height: 90px;
background: url(images/footer.jpg) repeat left top;
}
</style>
</head>
<script language="javascript">
function clickForm()
{
with(document.loginForm)
{
if(userName.value=="")
{
alert("用户名不能为空");
userName.focus();
return false;
}else{
var strP=userName.value;
var pattern=/^[a-z0-9A-Z]{4,25}$/;
flag=pattern.test(strP);
if(!flag){
alert("用户名长度4-25位,字符为0-9,a-z,A-Z");
userName.focus();
return false;
}
}
if(password.value=="")
{
alert("密码不能为空");
password.focus();
return false;
} else{
var strP=password.value;
var pattern=/^[a-z0-9A-Z]{4,25}$/;
flag=pattern.test(strP);
if(!flag){
alert("密码长度4-25位,字符为0-9,a-z");
password.focus();
return false;
}
}
submit();
return true;
}
}
</script>
<body scroll="no" bgcolor="E0E7F1">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15" colspan="2" class="top01"></td>
</tr>
<tr>
<td class="middle2_1"> </td>
<td width="850"><img src="images/middle2_2.jpg"/></td>
</tr>
<tr>
<td colspan="2" align="center" valign="top" class="middle03"><form id=loginForm name=loginForm action="/OA/login.do" method=post>
用户名:<input size=25 name=userName>
密 码:<input id=pwd type=password size=25 name=password>
<img style="cursor: hand" type=image src="images/button1.jpg" οnclick="return clickForm();">
</form></td>
</tr>
<tr>
<td colspan="2" class="bottom01" align="center"><table width="400" height="90" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center" valign="middle" class="footer"></td>
</tr></table>
<label>
</label></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
loginErr.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="refresh" content="5;url=login.jsp" />
<title>登陆出错啦!</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
}
a:link {
color: #0066CC;
text-decoration: none;
}
a:visited {
color: #FF6633;
text-decoration: none;
}
a:active {
color: #CC3399;
text-decoration: none;
}
a:hover {
text-decoration: none;
}
.STYLE4 {
font-size: 14px;
color: #000000;
font-weight: bold;
}
-->
</style></head>
<body>
<table width="945" height="334" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" valign="top"><table width="940" height="82" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="58" colspan="2" align="center" valign="middle"><p class="STYLE4">提示:<%
String message=request.getAttribute("message").toString();
out.print(message);
%></p> </td>
</tr>
<tr>
<td width="504" align="center" valign="middle"> </td>
<td width="436" align="left" valign="middle"><a href="login.jsp">返回登陆页面</a></td>
</tr>
</table>
<table width="272" height="224" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="272" height="272" background="images/error.gif"> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
main.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*"%>
<%@ page import="com.struts.domain.*"%>
<%
request.setCharacterEncoding("gb2312");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Page-Enter" content="revealTrans(duration=x, transition=y)">
<script type="text/javascript" src="js/wans01.js"></script>
<script type="text/javascript" src="js/cb.js"></script>
<link rel="stylesheet" href="css/wans02.css" type="text/css" media="screen, print" />
<!--[if lt IE 7]>
<style type="text/css">
/* Serve gif images to IE/Win pre version 7 */
.i1,
.i2 { background-image:url(images/borders.gif); }
.bt,
.bt div,
.bb,
.bb div { background-image:url(images/box.gif); }
/* Set a height to fix up some rendering issues. */
.i1,
.i3 { height:1px; }
</style>
<![endif]-->
</head>
<body>
<div id="main">
<div class="cbb">
<h1><img src="images/+.jpg" width="24" height="14">我的公告</h1>
<ol>
<li>◇ 列表项1</li>
<li>◇ 列表项2</li>
<li>◇ 列表项3</li>
<li>◇ 列表项4</li>
<li>◇ 列表项5</li>
<li>◇ 列表项6</li>
</ol>
<div class="more"><a href="#">更多...</a></div>
</div>
<div class="cbb two">
<p class="ht"> <img src="images/+.jpg" width="24" height="14">企业新闻</p>
<div id="ss1">
<ol>
<li>◇ 列表项1</li>
<li>◇ 列表项2</li>
<li>◇ 列表项3</li>
<li>◇ 列表项4</li>
<li>◇ 列表项5</li>
<li>◇ 列表项6</li>
</ol>
<div class="more"><a href="#">更多...</a></div>
</div>
</div>
<div class="cbb three">
<p class="ht"><img src="images/+.jpg" width="24" height="14">待办事项</p>
<div id="ss2">
<ol>
<li>◇ 列表项1</li>
<li>◇ 列表项2</li>
<li>◇ 列表项3</li>
<li>◇ 列表项4</li>
<li>◇ 列表项5</li>
<li>◇ 列表项6</li>
</ol>
<div class="more"><a href="#">更多...</a></div>
</div>
</div>
<div class="cbb two">
<p class="ht"><img src="images/+.jpg" width="24" height="14">工作计划</p>
<div id="ss3">
<ol>
<li>◇ 列表项a</li>
<li>◇ 列表项b</li>
<li>◇ 列表项c</li>
<li>◇ 列表项d</li>
<li>◇ 列表项e</li>
<li>◇ 列表项f</li>
</ol>
<div class="more"><a href="#">更多...</a></div>
</div>
</div>
<div class="cbb three">
<p class="ht"><img src="images/+.jpg" width="24" height="14">我的邮件</p>
<div id="ss4">
<ol>
<li>◇ 列表项aaaa</li>
<li>◇ 列表项bbbb</li>
<li>◇ 列表项cccc</li>
<li>◇ 列表项dddd</li>
<li>◇ 列表项eeee</li>
<li>◇ 列表项ffff</li>
</ol>
<div class="more"><a href="#">更多...</a></div>
</div>
</div>
<div id="cbt">
</div>
</div>
<script language="javascript" type="text/javascript">
var ss_array = ['0', '1', '2', '3', '4'];
ssCount = ss_array.length;
for (var i = 0; i < ssCount; i++) {
$('#ss'+ss_array[i]).fadeIn("slow");
}
$("li").mouseover(
function() {
this.style.backgroundColor='#E2FCEC';
}
);
$("li").mouseout(
function() {
this.style.backgroundColor='';
}
);
</script>
</body>
</html>