單元測試成功了,可以看到數(shù)據(jù)庫中的數(shù)據(jù),但是顯示頁面時,沒有出現(xiàn)列表,代碼如下
JSP代碼
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css'/>
<link href="css/beyond.min.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="css/default.css" />
<style type="text/css">
#navia{
width:100%;
position:relative;
word-wrap:break-word;
border-bottom:1px solid #065FB9;
margin:0;
padding:0;
height:40px;
line-height:40px;
vertical-align:middle;
border-top-left-radius:12px;
? ? border-top-right-radius:12px;
? ? background-image: -moz-linear-gradient(top,#EBEBEB, #BFBFBF);
? ? background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #EBEBEB),color-stop(1,?
#BFBFBF));
}
#tips{
margin-top:10px;
width:100%;
height:40px;
}
#buttonGroup{
padding-left:10px;
float:left;
height:35px;
}
.button{
float:left;
margin-right:10px;
padding-left:10px;
padding-right:10px;
font-size:14px;
width:120px;
height:30px;
line-height:30px;
vertical-align:middle;
text-align:center;
cursor:pointer;
? ? border-color: #77D1F6;
? ? border-width: 1px;
? ? border-style: solid;
? ? border-radius: 6px 6px;
? ? -moz-box-shadow: 2px 2px 4px #282828;
? ? -webkit-box-shadow: 2px 2px 4px #282828;
? ? background-image: -moz-linear-gradient(top,#EBEBEB, #BFBFBF);
? ? background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #EBEBEB),color-stop(1, #BFBFBF));
}
#mainContainer{
padding-left:10px;
padding-right:10px;
text-align:center;
width:98%;
font-size:12px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="logo">LOGO</div>
<div id="title">后臺管理系統(tǒng)</div>
<div id="user_info">
<div id="welcome">歡迎${sessionScope.loginName}使用本系統(tǒng)</div>
<div id="logout"><a href="<%=path%>/Admin_logout.action">安全退出</a></div>
</div>
</div>
<div id="navigator">
? ?<div class="page-sidebar" id="sidebar" style="width:195px;">
? ? ? ? ? ? ? ? <!-- Page Sidebar Header-->
? ? ? ? ? ? ? ? <div id="navi">
?
</div>
? ? ? ? ? ? ? ? <!-- /Page Sidebar Header -->
? ? ? ? ? ? ? ? <!-- Sidebar Menu -->
? ? ? ? ? ? ? ? <ul class="nav sidebar-menu">
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? <li class="active text-center">
? ? ? ? ? ? ? ? ? ? ? ? <a href="login_success.jsp">
? ? ? ? ? ? ? ? ? ? ? ? ? ? <span class="menu-text"> 系統(tǒng)管理</span>
? ? ? ? ? ? ? ? ? ? ? ? </a>
? ? ? ? ? ? ? ? ? ? </li>
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? <li class=" text-center">
? ? ? ? ? ? ? ? ? ? ? ? <a href="agency_auth_list.html">
? ? ? ? ? ? ? ? ? ? ? ? ? ? <span class="menu-text"> 成績管理 </span>
? ? ? ? ? ? ? ? ? ? ? ? </a>
? ? ? ? ? ? ? ? ? ? </li>
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? <li class=" text-center">
? ? ? ? ? ? ? ? ? ? ? ? <a href="agency_policies_list.html">
? ? ? ? ? ? ? ? ? ? ? ? ? ? <span class="menu-text"> 試卷管理 </span>
? ? ? ? ? ? ? ? ? ? ? ? </a>
? ? ? ? ? ? ? ? ? ? </li>
? ? ? ? ? ? ? ? </ul>
? ? ? ? ? ? ? ? <!-- /Sidebar Menu -->
? ? ? ? ? ? </div>
? ? ? ? </div>
<div id="main">
<!-- ?<iframe name="MainFrame" src="login_main.jsp"></iframe>-->
<div id="navia">
<!-- 導(dǎo)航空白 -->
? ? ? ? </div>
<div id="tips">
<div id="buttonGroup">
<div class="button" onmouseout="this.style.backgroundColor='';this.style.fontWeight='normal'" onmouseover="this.style.backgroundColor='#77D1F6';this.style.fontWeight='bold'">
<a href="<%=path%>/Score_add.jsp">添加成績</a>
</div>
<div class="button" onmouseout="this.style.backgroundColor='';this.style.fontWeight='normal'" onmouseover="this.style.backgroundColor='#77D1F6';this.style.fontWeight='bold'">
<a>查找學(xué)生成績</a>
</div>
</div>
</div>
<div id="mainContainer">
<!-- 從session中獲取學(xué)生集合 -->
<table class="default" width="100%">
<col width="15%">
<col width="15%">
<col width="20%">
<col width="10%">
<col width="10%">
<col width="30%">
<tr class="title">
<td>學(xué)號</td>
<td>姓名</td>
<td>班級</td>
<td>滿分</td>
<td>分數(shù)</td>
<td>課程名稱</td>
</tr>
<!-- 遍歷開始 -->
<s:iterator value="#session.score_list" var="stu">
<tr class="list">
<td><s:property value="#stu.sid"/></td>
<td><a href="<%=path%>/Score_modify.action?sid=<s:property value="#stu.sid"/>"><s:property value="#stu.sname"/></a></td>
<td><s:property value="#stu.sclass"/></td>
<td><s:property value="#stu.full"/></td>
<td><s:property value="#stu.score"/></td>
<td><s:property value="#stu.cname"/></td>
<td><a href="<%=path%>/Score_delete.action?sid=<s:property value="#stu.sid"/>" onclick="javascript: return confirm('真的要刪除嗎?');">刪除</a></td>
</tr>
</s:iterator>
<!-- 遍歷結(jié)束 -->
</table>
</div>
</div>
<div id="footer">Copyright ? 2015-2016 All Rights Reserved Powered By Qing</div>
</div>
</body>
<script type="text/javascript">
function screenAdapter(){
document.getElementById('footer').style.top=document.documentElement.scrollTop+document.documentElement.clientHeight- document.getElementById('footer').offsetHeight+"px";
document.getElementById('navigator').style.height=document.documentElement.clientHeight-100+"px";
document.getElementById('main').style.height=document.documentElement.clientHeight-100+"px";
document.getElementById('main').style.width=window.screen.width-230+"px";
}
window.onscroll=function(){screenAdapter();};
window.onresize=function(){screenAdapter();};
window.onload=function(){screenAdapter();};
</script>
<script src="js/jquery.min.js"></script>
</html>
是不是遍歷這有問題,不太明白這的意思
2016-06-01
你這里面沒有包含tree.jsp,所以沒有出現(xiàn)列表。