jsp分页,完整版

来源:互联网 发布:xyz域名怎么样 编辑:程序博客网 时间:2024/05/29 04:43
<div class="content_page"><div class="page_list"><c:choose>               <c:when test="${page==1}">              <a href="#" class="on"  onclick="validateFirst();">上一页</a>              </c:when>              <c:otherwise>              <a href="activitiyComList.htm?page=${page-1 }&id=${activityId}" class="on">上一页</a>              </c:otherwise>               </c:choose>               <c:choose>               <c:when test="${(page-6)>0 }" >               <a href="activitiyComList.htm?page=${p }&id=${activityId} ">1</a>               <a href="activitiyComList.htm?page=${p }&id=${activityId}">2</a>               <a href="#">...</a>               <c:choose>               <c:when test="${(page+4)<totalPage }">                    <c:forEach begin="${page-4 }" end="${page+4 }" var="p">                    <c:choose>                    <c:when test="${p==page }">                    <a href="#" style="color:red;" onclick="validateFirst();">${p }</a>                    </c:when>                    <c:otherwise>                    <a href="activitiyComList.htm?page=${p }&id=${activityId}">${p }</a>                    </c:otherwise>                    </c:choose>                   </c:forEach>                    <a href="#">...</a>               </c:when>               <c:otherwise>               <c:forEach begin="${page-4 }" end="${totalPage }" var="p">                    <c:choose>                    <c:when test="${p==page }">                    <a href="#" style="color:red;" onclick="validateFirst();">${p }</a>                    </c:when>                    <c:otherwise>                    <a href="activitiyComList.htm?page=${p }&id=${activityId}">${p }</a>                    </c:otherwise>                    </c:choose>                   </c:forEach>               </c:otherwise>               </c:choose>                  </c:when>                  <c:otherwise>                  <c:choose>                  <c:when test="${page+4>=totalPage }">                  <c:forEach begin="1" end="${totalPage }" var="p">                    <c:choose>                    <c:when test="${p==page }">                    <a href="#" style="color:red;" onclick="validateFirst();">${p }</a>                    </c:when>                    <c:otherwise>                    <a href="activitiyComList.htm?page=${p }&id=${activityId}">${p }</a>                    </c:otherwise>                    </c:choose>                    </c:forEach>                  </c:when>                  <c:otherwise>                  <c:forEach begin="1" end="${page+4 }" var="p">                    <c:choose>                    <c:when test="${p==page }">                    <a href="#" style="color:red;" onclick="validateFirst();">${p }</a>                    </c:when>                    <c:otherwise>                    <a href="activitiyComList.htm?page=${p }&id=${activityId}">${p }</a>                    </c:otherwise>                    </c:choose>                    </c:forEach>                    <a href="#">...</a>                  </c:otherwise>                  </c:choose>                  </c:otherwise>               </c:choose>  <c:choose>                   <c:when test="${page==totalPage}">                   <a href="#" class="on" onclick="validateLast();">下一页</a>                   </c:when>                   <c:otherwise>                   <a href="activitiyComList.htm?page=${page+1 }&id=${activityId}" class="on">下一页</a>                   </c:otherwise>                 </c:choose> </div></div>


0 0
原创粉丝点击