ajaxpage.jsp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
  2. <%@ include file="/base.jsp" %>
  3. <%-- 页面数据必须放到from中,以下form的名称和id不能改动。
  4. page.currentPage的ID不能改动
  5. 查询方法直接调用goPageAjax(1);
  6. <form action="/xx.do" name="searchForm" id="searchForm" method="post">
  7. <input type="hidden" id="pageCurrentPage" name="page.currentPage" value="${page.currentPage}"/> --%>
  8. <c:if test="${page != null && page.totalResultSize>0}">
  9. <div class="pagination pagination-large clearbottom">
  10. <ul>
  11. <!-- 首页 -->
  12. <c:choose>
  13. <c:when test="${page.first}">
  14. <li class="disabled"><a href="#">首页</a></li>
  15. </c:when>
  16. <c:otherwise>
  17. <li><a href="javascript:goPageAjax(1);">首页</a></li>
  18. </c:otherwise>
  19. </c:choose>
  20. <!-- 上一页 -->
  21. <c:choose>
  22. <c:when test="${page.first}">
  23. <li id="backpage" class="disabled"><a href="javascript:void(0)">←上一页</a></li>
  24. </c:when>
  25. <c:otherwise>
  26. <li id="backpage"><a href="javascript:goPageAjax(${page.currentPage-1 });">←上一页</a></li>
  27. </c:otherwise>
  28. </c:choose>
  29. <!-- 中间页码部分 -->
  30. <c:forEach items="${page.pageNums}" var="pageNums">
  31. <c:choose>
  32. <c:when test="${pageNums==page.currentPage}">
  33. <li class="active"><a href="javascript:void(0)">${pageNums}</a></li>
  34. </c:when>
  35. <c:otherwise>
  36. <li ><a href="javascript:goPageAjax(${pageNums})">${pageNums}</a></li>
  37. </c:otherwise>
  38. </c:choose>
  39. </c:forEach>
  40. <!--下一页 -->
  41. <c:choose>
  42. <c:when test="${page.last}">
  43. <li id="nextpage" class="disabled"><a href="javascript:void(0)">下一页→</a></li>
  44. </c:when>
  45. <c:otherwise>
  46. <li id="nextpage" ><a href="javascript:goPageAjax(${page.currentPage+1 })">下一页→</a></li>
  47. </c:otherwise>
  48. </c:choose>
  49. <!-- 尾页-->
  50. <c:choose>
  51. <c:when test="${page.last}">
  52. <li class="disabled"><a href="javascript:void(0)">尾页 </a></li>
  53. </c:when>
  54. <c:otherwise>
  55. <li ><a href="javascript:goPageAjax(${page.totalPageSize })">尾页 </a></li>
  56. </c:otherwise>
  57. </c:choose>
  58. </ul>
  59. </div>
  60. </c:if>