用jsp写了一个分页,可显示是是从第0页开始的,而我想从第一页开始该怎么修改。 10
补充问题:添加的数据在数据库中可以看到,可在页面上却看不到,这是怎么回事,求解释!!!<c:choose><c:whentest="${requestScope.page...
补充问题:添加的数据在数据库中可以看到,可在页面上却看不到,这是怎么回事,求解释!!!
<c:choose>
<c:when test="${requestScope.page.pageCount <= 6}">
<c:forEach begin="1" end="${requestScope.page.pageCount}" var="s" varStatus="status">
<c:choose>
<c:when test="${requestScope.page.pageNo==status.index}">
<a href="servlet/ListProductServlet?pageNo=${ status.index}" style="color:red;">[${ status.index}]</a>
</c:when>
<c:otherwise>
<a href="servlet/ListProductServlet?pageNo=${ status.index}">[${ status.index}]</a>
</c:otherwise>
</c:choose>
</c:forEach>
</c:when>
<c:otherwise>
<c:choose>
<c:when test="${requestScope.page.pageNo <= 3}">
<c:forEach begin="1" end="9" varStatus="status">
<c:choose>
<c:when test="${requestScope.page.pageNo==status.index}">
<a href="servlet/ListProductServlet?pageNo=${ status.index}" style="color:red;">[${ status.index}]</a>
</c:when>
<c:otherwise>
<a href="servlet/ListProductServlet?pageNo=${ status.index}">[${ status.index}]</a>
</c:otherwise>
</c:choose>
</c:forEach>
</c:when>
<c:when test="${requestScope.page.pageNo > (requestScope.page.pageCount-3)}">
<c:forEach begin="${requestScope.page.pageCount-3}" end="${requestScope.page.pageCount}" varStatus="status">
<c:choose>
<c:when test="${requestScope.page.pageNo==status.index}">
<a href="servlet/ListProductServlet?pageNo=${ status.index}" style="color:red;">[${ status.index}]</a>
</c:when>
<c:otherwise>
<a href="servlet/ListProductServlet?pageNo=${ status.index}">[${ status.index}]</a>
</c:otherwise>
</c:choose>
</c:forEach>
</c:when>
<c:otherwise>
${page.pageNo}
<c:forEach begin="${requestScope.page.pageNo}" end="${requestScope.page.pageNo + 3}" varStatus="status">
${page.pageNo}
<c:choose>
<c:when test="${requestScope.page.pageNo==status.index}">
<a href="servlet/ListProductServlet?pageNo=${ status.index}" style="color:red;">[${ status.index}]</a>
</c:when>
<c:otherwise>
<a href="servlet/ListProductServlet?pageNo=${ status.index}">[${ status.index}]</a>
</c:otherwise>
</c:choose>
</c:forEach>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose> 展开
<c:choose>
<c:when test="${requestScope.page.pageCount <= 6}">
<c:forEach begin="1" end="${requestScope.page.pageCount}" var="s" varStatus="status">
<c:choose>
<c:when test="${requestScope.page.pageNo==status.index}">
<a href="servlet/ListProductServlet?pageNo=${ status.index}" style="color:red;">[${ status.index}]</a>
</c:when>
<c:otherwise>
<a href="servlet/ListProductServlet?pageNo=${ status.index}">[${ status.index}]</a>
</c:otherwise>
</c:choose>
</c:forEach>
</c:when>
<c:otherwise>
<c:choose>
<c:when test="${requestScope.page.pageNo <= 3}">
<c:forEach begin="1" end="9" varStatus="status">
<c:choose>
<c:when test="${requestScope.page.pageNo==status.index}">
<a href="servlet/ListProductServlet?pageNo=${ status.index}" style="color:red;">[${ status.index}]</a>
</c:when>
<c:otherwise>
<a href="servlet/ListProductServlet?pageNo=${ status.index}">[${ status.index}]</a>
</c:otherwise>
</c:choose>
</c:forEach>
</c:when>
<c:when test="${requestScope.page.pageNo > (requestScope.page.pageCount-3)}">
<c:forEach begin="${requestScope.page.pageCount-3}" end="${requestScope.page.pageCount}" varStatus="status">
<c:choose>
<c:when test="${requestScope.page.pageNo==status.index}">
<a href="servlet/ListProductServlet?pageNo=${ status.index}" style="color:red;">[${ status.index}]</a>
</c:when>
<c:otherwise>
<a href="servlet/ListProductServlet?pageNo=${ status.index}">[${ status.index}]</a>
</c:otherwise>
</c:choose>
</c:forEach>
</c:when>
<c:otherwise>
${page.pageNo}
<c:forEach begin="${requestScope.page.pageNo}" end="${requestScope.page.pageNo + 3}" varStatus="status">
${page.pageNo}
<c:choose>
<c:when test="${requestScope.page.pageNo==status.index}">
<a href="servlet/ListProductServlet?pageNo=${ status.index}" style="color:red;">[${ status.index}]</a>
</c:when>
<c:otherwise>
<a href="servlet/ListProductServlet?pageNo=${ status.index}">[${ status.index}]</a>
</c:otherwise>
</c:choose>
</c:forEach>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose> 展开
1个回答
2012-05-29
展开全部
<c:forEach begin="${requestScope.page.pageCount-3}" end="${requestScope.page.pageCount}" varStatus="status">
<c:forEach begin="${requestScope.page.pageCount-2}" end="${requestScope.page.pageCount}" varStatus="status">
<c:forEach begin="${requestScope.page.pageCount-2}" end="${requestScope.page.pageCount}" varStatus="status">
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询