方法:
只需在下面两处修改就可以。下面示范每页显示四条信息的修改
原文:
// 计算总页数,不能整除的进1
totalPage = BigDecimal.valueOf(totalRow).divide(SystemStateConstant.PAGENUM, BigDecimal.ROUND_UP).intValue();
//获取店铺信息集合
sql = "select * from (select * from store where isDel=0 order by createDate desc) t limit "
+ ((pageNumber-1) * SystemStateConstant.PAGENUM.intValue()) + "," + SystemStateConstant.PAGENUM.intValue();
修改:
// 计算总页数,不能整除的进1
totalPage = BigDecimal.valueOf(totalRow).divide(new BigDecimal("4"), BigDecimal.ROUND_UP).intValue();
//获取店铺信息集合
sql = "select * from (select * from store where isDel=0 order by createDate desc) t limit "
+ (pageNumber-1) * 4 + ", 4" ;
下面展示页面分页按钮的写法,黑色部分为分页内容所调用的方法
<!--分页-->
<div>
<ul class="pager">
<%include("/DirectorEditPages/commonPage/_paginate.html", {"currentPage": pageNumber!1, "totalPage": totalPage!1, "totalRow": totalRow!0, "actionUrl": contextPath+"/storeWeb/toStorePage?typeCode=" + typeCode! + "&pageNumber=", "urlParas": urlParas!''}){}%>
</ul>
</div>
<!--分页-->