index.jsp
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/2/17
Time: 15:46
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>$Title$</title>
</head>
<body>
<a href="customer.jsp">
<button>客户列表</button>
</a>
</body>
</html>
customer.jsp
<%@ page import="java.util.List" %>
<%@ page import="org.th.customer" %><%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/2/17
Time: 14:48
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>客户列表</title>
</head>
<servlet>
<servlet-name>list</servlet-name>
<servlet-class>list</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>list</servlet-name>
<url-pattern>/list</url-pattern>
</servlet-mapping>
<body>
<h1>客户列表</h1>
<%
List<customer> customers=(List<customer>) request.getAttribute("customers");
%>
<table border="1">
<thead>
<tr>
<th>cust_id</th>
<th>cust_name</th>
<th>email</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<%
int a;
for(a=0;a<customers.size();a++){
%>
<tr>
<td><%=customers.get(a).getId()%></td>
<td><%=customers.get(a).getName()%></td>
<td><%=customers.get(a).getEmail()%></td>
<td><input type="button" value="删除" class="delete" >/<input type="button" value="修改" class="updata" ></td>
</tr>
<%
}
%>
</tbody>
</table>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/2/17
Time: 15:46
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>$Title$</title>
</head>
<body>
<a href="customer.jsp">
<button>客户列表</button>
</a>
</body>
</html>
customer.jsp
<%@ page import="java.util.List" %>
<%@ page import="org.th.customer" %><%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/2/17
Time: 14:48
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>客户列表</title>
</head>
<servlet>
<servlet-name>list</servlet-name>
<servlet-class>list</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>list</servlet-name>
<url-pattern>/list</url-pattern>
</servlet-mapping>
<body>
<h1>客户列表</h1>
<%
List<customer> customers=(List<customer>) request.getAttribute("customers");
%>
<table border="1">
<thead>
<tr>
<th>cust_id</th>
<th>cust_name</th>
<th>email</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<%
int a;
for(a=0;a<customers.size();a++){
%>
<tr>
<td><%=customers.get(a).getId()%></td>
<td><%=customers.get(a).getName()%></td>
<td><%=customers.get(a).getEmail()%></td>
<td><input type="button" value="删除" class="delete" >/<input type="button" value="修改" class="updata" ></td>
</tr>
<%
}
%>
</tbody>
</table>
</body>
</html>