```java
```java
import java.util.ArrayList;
public class PageBean<T> {
//当前页
private int currentPage;
//当前页显示的条数
private int currentCount;
//总条数
private int totalCount;
//总页数
private int totalPage;
//每页显示的数据
private ArrayList<T> productList=new ArrayList<T>();
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public int getCurrentCount() {
return currentCount;
}
public void setCurrentCount(int currentCount) {
this.currentCount = currentCount;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public ArrayList<T> getProductList() {
return productList;
}
public void setProductList(ArrayList<T> productList) {
this.productList = productList;
}
}
import java. io. IOException;
import java. sql. SQLException;
import javax. servlet. ServletException;
import javax. servlet. annotation. WebServlet;
import javax. servlet. http. HttpServlet;
import javax. servlet. http. HttpServletRequest;
import javax. servlet. http. HttpServletResponse;
import domain. Product;
import service. ProductService;
import vo. PageBean;
@WebServlet ( "/ProductPageListServlet" )
public class ProductPageListServlet extends HttpServlet {
private static final long serialVersionUID = 1 L;
public ProductPageListServlet ( ) {
super ( ) ;
}
protected void doGet ( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ProductService service= new ProductService ( ) ;
PageBean < Product> pageBean= null;
int currentPage= 1 ;
String _currentPage= request. getParameter ( "currentPage" ) ;
if ( _currentPage!= null) {
currentPage= Integer. parseInt ( _currentPage) ;
}
int currentCount= 5 ;
try {
pageBean= service. findPageBean ( currentPage, currentCount) ;
} catch ( SQLException e) {
e. printStackTrace ( ) ;
}
request. setAttribute ( "pageBean" , pageBean) ;
System. out. println ( pageBean. getProductList ( ) ) ;
request. getRequestDispatcher ( "/admin/product/list.jsp" ) . forward ( request, response) ;
}
protected void doPost ( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet ( request, response) ;
}
}
< % @page import = "java.util.ArrayList" % >
< % @page contentType= "text/html" pageEncoding= "UTF-8" % >
< % @ taglib uri= "http://java.sun.com/jsp/jstl/core" prefix= "c" % >
< % @ page import = "domain.Product" % >
< ! DOCTYPE html>
< html>
< head>
< meta http- equiv= "Content-Type" content= "text/html; charset=UTF-8" >
< meta http- equiv= "X-UA-Compatible" content= "IE=edge" >
< title> JSP Page< / title>
< link rel= "stylesheet" href= "<%=request.getContextPath()%>/res/css/bootstrap.min.css" type= "text/css" media= "screen" / >
< script type= "text/javascript" >
function delProduct ( id) {
var isDel= confirm ( "你确定要删除吗?" ) ;
if ( isDel) {
location. href= "${pageContext.request.contextPath}/DelProductServlet?id=" + id;
}
}
< / script>
< / head>
< body>
< h3> 条件查询< / h3>
< h3> 书籍信息< / h3>
< table>
< tr>
< th> 序号< / th>
< th> 书名< / th>
< th> 图片< / th>
< th> 价格< / th>
< th> 类别< / th>
< th> 数量< / th>
< th> 信息介绍< / th>
< th colspan= "2" > 操作< / th>
< / tr>
< c: forEach items= "${pageBean.productList}" var= "pro" varStatus= "vs" >
< tr>
< td> ${ vs. count} < / td>
< td> ${ pro. name} < / td>
< td> < img width= "40" height= "45" src= "${pageContext.request.contextPath}/${pro.imgurl}" / > < / td>
< td> ${ pro. price} < / td>
< td> ${ pro. category} < / td>
< td> ${ pro. pnum} < / td>
< td> ${ pro. description} < / td>
< td> < a href= "${pageContext.request.contextPath}/editProductServlet?id=${pro.id}" > 修改< / a> < / td>
< td> < a href= "javascript:void(0);" onclick= "delProduct('${pro.id}')" > 删除< / a> < / td>
< / tr>
< / c: forEach>
< / table>
< ! -- 分页 -- >
< table>
< tr>
< ! -- 上一页 -- >
< c: if test= "${pageBean.currentPage==1}" >
< td> < a href= "javascript:void(0);" > 上一页< / a> < / td>
< / c: if >
< c: if test= "${pageBean.currentPage!=1}" >
< td>
< a href= "${pageContext.request.contextPath}/ProductPageListServlet?currentPage=${pageBean.currentPage-1}" > 上一页< / a>
< / td>
< / c: if >
< ! -- 循环输出页面号 -- >
< c: forEach begin= "1" end= "${pageBean.totalPage}" var= "pageNum" >
< c: if test= "${pageNum==pageBean.currentPage}" >
< td> ${ pageNum} < / td>
< / c: if >
< c: if test= "${pageNum!=pageBean.currentPage}" >
< td> < a href= "${pageContext.request.contextPath}/ProductPageListServlet?currentPage=${pageBean.currentPage}" > ${ pageNum} < / a> < / td>
< / c: if >
< / c: forEach>
< ! -- 下一页 -- >
< c: if test= "${pageBean.currentPage==pageBean.totalPage||pageBean.totalPage==0}" >
< td> < a href= "javascript:void(0);" > 下一页< / a> < / td>
< / c: if >
< c: if test= "${pageBean.currentPage!=pageBean.totalPage&&pageBean.totalPage!=0}" >
< td>
< a href= "${pageContext.request.contextPath}/ProductPageListServlet?currentPage=${pageBean.currentPage+1}" > 下一页< / a>
< / td>
< / c: if >
< tr>
< / table>
< / body>
< / html>