jstl标签库分页

几年以前利用jstl标签库进行分页的页面代码,现在贴出来记录一下(用到的时候也好翻出来):

<tr>
			   		<td width="100%" colspan="9" align="right">	
			   		本页${listSize}条记录      
			   			<a href='${pageContext.request.contextPath}/station/doListQuery.do?pageNo=1&minTime=${minTime }&maxTime=${maxTime }'>首页|</a>
			   			<c:choose>
			   				<c:when test="${pageNo-1 ge 1}">
			   					<a href='${pageContext.request.contextPath}/station/doListQuery.do?pageNo=${pageNo-1}&minTime=${minTime }&maxTime=${maxTime }'>上一页|</a>
			   				</c:when>
			   				<c:otherwise>
			   					<a href='${pageContext.request.contextPath}/station/doListQuery.do?pageNo=1&minTime=${minTime }&maxTime=${maxTime }'>上一页|</a>
			   				</c:otherwise>
			   			</c:choose>
			   			<c:choose>
			   				<c:when test="${pageNo+1 le totalPages}">
			   					<a href='${pageContext.request.contextPath}/station/doListQuery.do?pageNo=${pageNo+1}&minTime=${minTime }&maxTime=${maxTime }'>下一页|</a>
			   				</c:when>
			   				<c:otherwise>
			   					<a href='${pageContext.request.contextPath}/station/doListQuery.do?pageNo=${totalPages}&minTime=${minTime }&maxTime=${maxTime }'>下一页|</a>
			   				</c:otherwise>
			   			</c:choose>			   			
			   			<a href='${pageContext.request.contextPath}/station/doListQuery.do?pageNo=${totalPages}&minTime=${minTime }&maxTime=${maxTime }'>末页</a>	
			   			      第${pageNo}页/共${totalPages}页			   			
			   		</td>
			   	</tr>  


说明:实际上分页所需的参数一般情况下只需要patNo、totalPages,后面的minTime、maxTime只是传参而已。


你可能感兴趣的:(jstl标签库分页)