1、先新建一个与分页信息有关的类
package model;
public class PageBean {
private int currentPage;//当前页数
private int pageSize;//每页显示记录数
private int start;//每页开始的记录数
private int totalPage;//总页数
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public PageBean(int currentPage, int pageSize) {
super();
this.currentPage = currentPage;
this.pageSize = pageSize;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getStart() {
return (currentPage-1)*pageSize;
}
public void setStart(int start) {
this.start = start;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
}
(其中的每页显示的第