pager-taglib 中 页码的算法 Leave a Comment / Java / August 20, 2008 August 20, 2008 如 int totalCount = 记录总数; int itemCountForPage = 每页记录数; 那么 int pageCount= totalCount / itemCountForPage + (totalCount % itemCountForPage == 0 ? 0 : 1); // 页数 int offset = (pageCount- 1) * itemCountForPage ; //在URL里作为参数pager.offset的值