// 查询出一共有多少条记录
String countViewNum = confirmService.getCountViewNumHis(currentId,accountInfo.getAccountId().toString(),accountName,accountType,form);
// 一共有多少页
String maxPage = null;
int vn = new Integer(countViewNum).intValue();
// 10表示每页显示的记录数量
int i = vn / Constants.PAGE_SIZE;
if(vn % Constants.PAGE_SIZE > 0)
{
i++;
}
maxPage = new Integer(i).toString();
// 最大页为0时,默认共1页
if (i == 0)
{
maxPage = "1";
}
// 当查询的页数大于总页数时,返回第一页。
if (jumpPage > i)
{
jumpPage = 1;
}
// 当前要显示的页面号
request.setAttribute("currentPage", new Integer(jumpPage).toString());
//所有的数据数量
request.setAttribute("countViewNum", countViewNum);
// 一共有多少页
request.setAttribute("maxPage", maxPage);