1.开始页面(查询数据)

 1 <%@page import="com.zdsofe.work.Student"%>
 2 <%@page import="java.util.List"%>
 3 <%@page import="com.zdsofe.work.ReadData"%>
 4 <%@ page language="java" contentType="text/html; charset=UTF-8"
 5     pageEncoding="UTF-8"%>
 6 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 7 <html>
 8 <head>
 9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
10 <title>Insert title here</title>
11 </head>
12 <body>
13 <% ReadData rd=new ReadData();
14   List<Student> list= rd.findInfo();
15 %>
16 
17 <table border="1">
18 <tr>
19 <th>序号</th>
20 <th>名字</th>
21 <th>密码</th>
22 <th>操作</th>
23 </tr>
24 
25 
26 <%
27 for(int i=0;i<list.size();i++)
28 {
29     %>
30     <tr>
31     <td><%=list.get(i).getId()%></td>
32     <td><%=list.get(i).getUserName()%></td>
33     <td><%=list.get(i).getMima()%></td>
34     <td><a href="../servlet?userN=<%=list.get(i).getUserName()%>">修改</a>
35         <a href="../DeleteServlet?userI=<%=list.get(i).getId()%>">删除</a>
36     </td>
37     </tr>
38 <% 
39   }
40 %>
41 
42 </table>
43 </body>
44 </html>
View Code

相关文章: