最后是页面代码
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="cn.edu.bzu.dao.czgameDAO,cn.edu.bzu.entity.czgame"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test-newsTitle</title>
</head>
<body>
<table border="1">
<tr>
<!-- <td>id</td> -->
<td>game</td>
<td>type</td>
</tr>
<%
czgameDAO dao=new czgameDAO();
List<czgame> list =dao.readFirstczgame();
for(czgame tl:list)
{%>
<tr>
<!-- <td><%=tl.getId() %></td> -->
<td><%=tl.getgame() %></td>
<td><%=tl.gettype() %></td>
</tr>
<%}
%>
</table>
</body>
</html>