index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import="com.bean.*" %>
<%
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>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<jsp:useBean id="datamanger" class="com.dbc.DataManger"></jsp:useBean>
<body>
<table width=80% border="1" bgcolor="#FFFFF">
<tr>
<td>分院名称</td>
<td>班级名称</td>
<td>班主任</td>
<td>学习委员</td>
<td>修改数据</td>
<td>删除数据</td>
</tr>
<%
Collection temp = datamanger.getAllData();
Iterator it = temp.iterator();
while(it.hasNext()) {
ClassBean cb = (ClassBean)it.next();
out.println("<td>" + cb.getPartmentname() + "</td>");
out.println("<td>" + cb.getClassname() + "</td>");
out.println("<td>" + cb.getClasshead() + "</td>");
out.println("<td>" + cb.getStudenthead() + "</td>");
out.println("<td><a href='#'>修改</a></td>");
out.println("<td><a href='class_delete.jsp?Classid="+cb.getClassid()+"'>删除</a></td>");
}
%>
</table>
</body>
</html>
class_delete.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
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>
<base href="<%=basePath%>">
<title>My JSP 'class_delete.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>