• java bootstrap分页


    样式如下

    datumMap.total总共多少页

    datumMap.page第几页

        <nav class="pull-right">
    				<ul class="pagination">
    				<!-- 是否能点击前一页 -->
    				<c:choose>
    					<c:when test="${datumMap.page==1}">
    					<li class="disabled">
    						<a aria-label="Previous" href="javascript:void(0);">
    							<span aria-hidden="true">«</span>
    						</a>
    					</li>
    					</c:when>
    					<c:otherwise>
    					<li>
    						<a aria-label="Previous" href="${ctx_path}/datum/show_datum?page=${datumMap.page-1}">
    							<span aria-hidden="true">«</span>
    						</a>
    					</li>
    					</c:otherwise>
    				</c:choose>
    				<!-- 显示可以点击的页数 -->
    				<c:choose>
    					<c:when test="${datumMap.total<=5}">
    						<c:forEach var="p" begin="1" end="${datumMap.total}">
    						<li <c:if test="${datumMap.page==p}">class="active"</c:if>><a href="${ctx_path}/datum/show_datum?page=${p}">${p}</a></li>
    						</c:forEach>
    					</c:when>
    					<c:otherwise>
    						<c:choose>
    							<c:when test="${datumMap.page < 4 && datumMap.page > 0}"><!-- 1-3页 -->
    							<li <c:if test="${datumMap.page == 1}">class="active"</c:if>><a href="${ctx_path}/datum/show_datum?page=1">1</a></li>
    							<li <c:if test="${datumMap.page == 2}">class="active"</c:if>><a href="${ctx_path}/datum/show_datum?page=2">2</a></li>
    							<li <c:if test="${datumMap.page == 3}">class="active"</c:if>><a href="${ctx_path}/datum/show_datum?page=3">3</a></li>
    							<li <c:if test="${datumMap.page == 4}">class="active"</c:if>><a href="${ctx_path}/datum/show_datum?page=4">4</a></li>
    							<li><a href="javascript:void(0);" class="disabled">...</a></li>
    							<li><a href="${ctx_path}/datum/show_datum?page=${datumMap.total}">${datumMap.total}</a></li>
    							</c:when>
    							<c:when test="${datumMap.page < datumMap.total-2}">
    							<li><a href="${ctx_path}/datum/show_datum?page=${datumMap.page-2}">${datumMap.page-2}</a></li>
    							<li><a href="${ctx_path}/datum/show_datum?page=${datumMap.page-1}">${datumMap.page-1}</a></li>
    							<li class="active"><a href="${ctx_path}/datum/show_datum?page=${datumMap.page}">${datumMap.page}</a></li>
    							<li><a href="${ctx_path}/datum/show_datum?page=${datumMap.page+1}">${datumMap.page+1}</a></li>
    							<li><a href="javascript:void(0);" class="disabled">...</a></li>
    							<li><a href="${ctx_path}/datum/show_datum?page=${datumMap.total}">${datumMap.total}</a></li>
    							</c:when>
    							<c:otherwise>
    							<li><a href="${ctx_path}/datum/show_datum?page=${datumMap.total-4}">${datumMap.total-4}</a></li>
    							<li><a href="${ctx_path}/datum/show_datum?page=${datumMap.total-3}">${datumMap.total-3}</a></li>
    							<li <c:if test="${datumMap.page==datumMap.total-2}">class="active"</c:if>><a href="${ctx_path}/datum/show_datum?page=${datumMap.total-2}">${datumMap.total-2}</a></li>
    							<li <c:if test="${datumMap.page==datumMap.total-1}">class="active"</c:if>><a href="${ctx_path}/datum/show_datum?page=${datumMap.total-1}">${datumMap.total-1}</a></li>
    							<li <c:if test="${datumMap.page==datumMap.total}">class="active"</c:if>><a href="${ctx_path}/datum/show_datum?page=${datumMap.total}">${datumMap.total}</a></li>
    							</c:otherwise>
    						</c:choose>
    					</c:otherwise>
    				</c:choose>
    				<!-- 是否能点击后一页 -->
    				<c:choose>
    					<c:when test="${datumMap.page==datumMap.total}">
    					<li class="disabled">
    						<a aria-label="Next" href="javascript:void(0);">
    							<span aria-hidden="true">»</span>
    						</a>
    					</li>
    					</c:when>
    					<c:otherwise>
    					<li>
    						<a aria-label="Next" href="${ctx_path}/datum/show_datum?page=${datumMap.page+1}">
    							<span aria-hidden="true">»</span>
    						</a>
    					</li>
    					</c:otherwise>
    				</c:choose>
    				</ul>
    			</nav>        
    
  • 相关阅读:
    spring mvc+ELK从头开始搭建日志平台
    java分布式系统开关功能设计(服务升降级)
    可伸缩性架构常用技术
    大众点评订单系统分库分表实践
    分布式缓存--系列1 -- Hash环/一致性Hash原理
    Netty原理剖析
    一个轻量级分布式 RPC 框架 — NettyRpc
    HDU 2583 permutation
    HDU 2573 Typing
    c语言中逗号运算符和逗号表达式
  • 原文地址:https://www.cnblogs.com/guxingzhe/p/5275937.html
Copyright © 2020-2023  润新知