<div id="mainContainer"> <div id="mainContainerRepleace"> <div class="card mb-4" th:each="question : ${questionList}"> <div class="card-block"> <h2 class="card-title"> <a href="'/u/blogs/'+${question.id}" class="card-link" title="waylau" th:href="'/u/blogs/'+ ${question.id}" th:title="${question.questionTile}" th:text="${question.questionTile}"> </a> </h2> <p class="card-text" th:text="${question.questionType}"></p> <div class="card-text"> <a href="/u/waylau" th:href="'/u/' + ${question.createPersonName}" class="card-link" th:text=${question.id}>waylau</a> 提问于 [[${#dates.format(question.createTime, 'yyyy-MM-dd HH:mm')}]] </div> </div> <div th:replace="~{fragments/page :: page}">...</div> </div> </div> </div>
这样可以获取到page 但是这样就是为每一条数据分页 我想要的是整体分页 把分页的链接div放到下一层就获取不到代码和下面一样的时候就不可以
<div id="mainContainer">
<div id="mainContainerRepleace">
<div class="card mb-4" th:each="question : ${questionList}">
<div class="card-block">
<h2 class="card-title">
<a href="'/u/blogs/'+${question.id}" class="card-link" title="waylau"
th:href="'/u/blogs/'+ ${question.id}" th:title="${question.questionTile}" th:text="${question.questionTile}">
</a>
</h2>
<p class="card-text" th:text="${question.questionType}"></p>
<div class="card-text">
<a href="/u/waylau" th:href="'/u/' + ${question.createPersonName}" class="card-link" th:text=${question.id}>waylau</a> 提问于 [[${#dates.format(question.createTime, 'yyyy-MM-dd HH:mm')}]]
</div>
</div>
</div>
<div th:replace="~{fragments/page :: page}">...</div>
</div>
</div>
毕设 Elasticsearch搜索+Thymeleaf模板+JPA+Security+BootStrap
了解课程