目录
1.pagebean改造
// 保存上次地址
private String URL;
// 保存上次查询条件
private Map<String, String[]> parameterMap=new HashMap<String, String[]>();
//最大页
public int maxPage() {
return this.total%this.rows==0?this.total/this.rows:this.total/this.rows+1;
}
// 上一页
public int previousPage() {
return this.page > 1 ? this.page-1:this.page;
}
// 下一页
public int nextPage() {
return this.page < this.maxPage() ? this.page+1:this.page;
}
// 初始化
public void setRequest(HttpServletRequest request) {
this.setPage(request.getParameter("page"));
this.setRows(request.getParameter("rows"));
this.setPagination(request.getParameter("pagination"));
this.setURL(request.getRequestURI().toString());
this.setParameterMap(request.getParameterMap());
}
//=========================&