前台页面---基本的分页代码

<div id="buttomBar">
<c:if test="${pageBean.currentPage==1}">
<a href="<%=request.getContextPath()%>/queryMessages2.action?msgType=CPF&currentPage=${pageBean.currentPage+1}">下一页</a>
</c:if>

<c:if test="${pageBean.currentPage > 1 && pageBean.currentPage<pageBean.pageCount}">
<a href="<%=request.getContextPath()%>/queryMessages2.action?msgType=CPF&currentPage=${pageBean.currentPage-1}">上一页</a>
<a href="<%=request.getContextPath()%>/queryMessages2.action?msgType=CPF&currentPage=${pageBean.currentPage+1}">下一页</a>
</c:if>

<c:if test="${pageBean.currentPage==pageBean.pageCount}">
<a href="<%=request.getContextPath()%>/queryMessages2.action?msgType=CPF&currentPage=${pageBean.currentPage-1}">上一页</a>
</c:if>
<span>共${pageBean.pageCount}页,当前第${pageBean.currentPage}页.</span>
</div>

原文地址:https://www.cnblogs.com/wangzheguilai/p/8135040.html