從數據庫中讀取衆多數據,將其進行分頁展示。
<h2>
<!--<a href=\'#\'" /a> -->
<c:choose>
<c:when test="${page gt 1}">
<a href=\'#\'" /a>
</c:when>
<c:otherwise>
上一頁
</c:otherwise>
</c:choose>
|第 ${page} 頁|
<!-- <a href=\'#\'" /a> -->
<c:choose>
<c:when test="${page lt totalPages}">
<a href=\'#\'" /a>
</c:when>
<c:otherwise>
下一頁
</c:otherwise>
</c:choose>
</h2>
<
c:when
test
=
"${page
gt 1}"
>
當在第一頁的時候,不能再向前跳轉。
<
c:when
test
=
"${page
lt totalPages}"
>
當在最後一頁後,不能再向後跳轉。