<div class="scott"><span class="disabled"></span>
<span><a th:href="@{findgoods.do(pageNum=0)}">首页</a></span>
<span th:switch="${pageNum}">
<span th:case="1"> <a th:href="@{findgoods.do(pageNum=1)}">上一页</a></span>
<span th:case="*"><a th:href="@{findgoods.do(pageNum=${pageInfo.prePage})}">上一页</a></span>
</span>
<span th:switch="${pageNum}">
<span th:case="${pageInfo.pages}"><a th:href="@{findgoods.do(pageNum=${pageInfo.pages})}">下一页</a></span>
<span th:case="*"><a th:href="@{findgoods.do(pageNum=${pageInfo.nextPage})}">下一页</a></span>
</span>
<span><a th:href="@{findgoods.do(pageNum=${pageInfo.pages})}">尾页</a></span>
</div>
或者另一种写法
<center><span>当前第 <span th:text="${pageInfo.pageNum}"></span> 页,总 <span th:text="${pageInfo.pages}"></span> 页,共 <span th:text="${pageInfo.total}"></span> 条记录</span></center>
<div class="scott"><span class="disabled"></span>
<span><a th:href="@{findgoods.do(pageNum=1)}">首页</a></span>
<a th:href="@{findgoods.do(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a>
<span th:class="${pageNums == pageInfo.pageNum}?'active':''" th:each="pageNums : ${pageInfo.navigatepageNums}">
<a th:href="@{findgoods.do(pageNum=${pageNums})}" th:if="${pageNums != pageInfo.pageNum}" th:text="${pageNums}"></a>
<span th:if="${pageNums == pageInfo.pageNum}" th:text="${pageNums}"></span>
</span>
<a th:href="@{findgoods.do(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>
<span><a th:href="@{findgoods.do(pageNum=${pageInfo.pages})}">尾页</a></span>
</div>