<%@ page contentType=”text/html;charset=UTF-8” language=”java” %>
    <%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core“ %>



    <%
    pageContext.setAttribute(“path”,request.getContextPath());
    %>


    ${path} <%— /SSM —%>
    <%—搭建页面—%>

    <%—标题—%>


    SSM-CRUD




    <%—按钮—%>

    <%—列偏移—%>




    <%—显示表格数据—%>





















    ID 姓名 性别 邮箱 部门 操作
    ${employee.empId} ${employee.empName} ${employee.gender} ${employee.email} ${employee.department.deptName}





    <%—显示分页信息—%>

    <%—分选,点选条—%>


    <%—分页,信息条—%>

    当前第
    ${pageInfo.pageNum}
    页,共
    ${pageInfo.pages}
    页,共
    ${pageInfo.total}
    条记录




    <%—引入jQuery—%>

    <%—引入样式—%>



    1. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    3. <html>
    4. <head>
    5. <title>员工信息查询</title>
    6. <%
    7. pageContext.setAttribute("path",request.getContextPath());
    8. %>
    9. </head>
    10. <body>
    11. ${path}<%-- /SSM --%>
    12. <%--搭建页面--%>
    13. <div class="container">
    14. <%--标题--%>
    15. <div class="row">
    16. <div class=".col-lg-12">
    17. <h1>SSM-CRUD</h1>
    18. </div>
    19. </div>
    20. <%--按钮--%>
    21. <div class="row ">
    22. <div class="col-md-4 col-md-offset-8"><%--列偏移--%>
    23. <button type="button" class="btn btn-success">新增</button>
    24. <button type="button" class="btn btn-danger">删除</button>
    25. </div>
    26. </div>
    27. <%--显示表格数据--%>
    28. <div class="row ">
    29. <div class="col-md-12">
    30. <table class="table table-hover">
    31. <tr>
    32. <th>ID</th>
    33. <th>姓名</th>
    34. <th>性别</th>
    35. <th>邮箱</th>
    36. <th>部门</th>
    37. <th>操作</th>
    38. </tr>
    39. <c:forEach items="${pageInfo.list}" var="employee">
    40. <tr>
    41. <th>${employee.empId}</th>
    42. <th>${employee.empName}</th>
    43. <th>${employee.gender}</th>
    44. <th>${employee.department.deptName}</th>
    45. <th>工程部</th>
    46. <th>
    47. <button class="btn btn-primary">
    48. <span class="glyphicon glyphicon-pencil btn-xs" aria-hidden="true"></span>
    49. 编辑
    50. </button>
    51. <button class="btn btn-danger">
    52. <span class="glyphicon glyphicon-trash btn-xs" aria-hidden="true"></span>
    53. 删除
    54. </button>
    55. </th>
    56. </tr>
    57. </c:forEach>
    58. </table>
    59. </div>
    60. </div>
    61. <%--显示分页信息--%>
    62. <div class="row">
    63. <%--分选,点选条--%>
    64. <nav aria-label="Page navigation">
    65. <ul class="pagination">
    66. <%--首页--%>
    67. <li>
    68. <a href="${path}/list?pageNumber=1">首页</a>
    69. </li>
    70. <%--判断是否有上一页,有才执行--%>
    71. <c:if test="${pageInfo.hasPreviousPage}">
    72. <li>
    73. <%--方式一:href="${path}/list?pageNumber=${pageInfo.pageNum-1}" --%>
    74. <a href="${path}/list?pageNumber=${pageInfo.prePage}" aria-label="Previous"><%--上一页--%>
    75. <span aria-hidden="true">&laquo;</span>
    76. </a>
    77. </li>
    78. </c:if>
    79. <%--遍历获取在页面需要连续显示的页码12345678--%>
    80. <c:forEach items="${pageInfo.navigatepageNums}" var="page_Num">
    81. <c:if test="${page_Num == pageInfo.pageNum}"><%--判断 当前页面显示中的每个页码中 是否有个页码等于 当前页码 --%>
    82. <li class="active">
    83. <a href="#" >${page_Num}</a><%--如果是当页面页码 激活高亮状态--%>
    84. </li>
    85. </c:if>
    86. <c:if test="${page_Num != pageInfo.pageNum}" var="page_num">
    87. <li>
    88. <a href="${path}/list?pageNumber=${page_Num}">${page_Num}</a><%--如果不是当前页码,禁用状态--%>
    89. </li>
    90. </c:if>
    91. </c:forEach>
    92. <%--判断有下一页才执行--%>
    93. <c:if test="${pageInfo.hasNextPage}">
    94. <li>
    95. <%--方式一:<a href="${path}/list?pageNumber=${pageInfo.pageNum+1}" aria-label="Next">--%>
    96. <a href="${path}/list?pageNumber=${pageInfo.nextPage}" aria-label="Next">
    97. <span aria-hidden="true">&raquo;</span>
    98. </a>
    99. </li>
    100. </c:if>
    101. <%--末页--%>
    102. <li>
    103. <a href="${path}/list?pageNumber=${pageInfo.pages}">末页</a>
    104. </li>
    105. </ul>
    106. </nav>
    107. <%--分页,信息条--%>
    108. <div class="col-md-4">
    109. 当前第
    110. ${pageInfo.pageNum}
    111. 页,共
    112. ${pageInfo.pages}
    113. 页,共
    114. ${pageInfo.total}
    115. 条记录
    116. </div>
    117. </div>
    118. </div>
    119. </div>
    120. <%--引入jQuery--%>
    121. <script type="text/javascript" src="${path}/static/script/jquery-1.7.2.js"></script>
    122. <%--引入样式--%>
    123. <link href="${path}/static/bootstrap-3.4.1-dist/css/bootstrap.min.css" rel="stylesheet">
    124. <script src="${path}/static/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
    125. </body>
    126. </html>