单元测试成功了,可以看到数据库中的数据,但是显示页面时,没有出现列表,代码如下
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">后台管理系统</div>
<div id="user_info">
<div id="welcome">欢迎${sessionScope.loginName}使用本系统</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"> 系统管理</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">
<!-- 导航空白 -->
</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>查找学生成绩</a>
</div>
</div>
</div>
<div id="mainContainer">
<!-- 从session中获取学生集合 -->
<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>学号</td>
<td>姓名</td>
<td>班级</td>
<td>满分</td>
<td>分数</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>
<!-- 遍历结束 -->
</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>
是不是遍历这有问题,不太明白这的意思