关于分页的JSTL版本

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="content-language" content="zh-CN" />  
	<title>订单列表</title>
	<meta name="Keywords" content="订单列表"/>
	<meta name="Description" content="订单列表"/>
 </head>
 <body>
   <h1>订单列表</h1>
	 
		<table>
		<tr>
			<th>消费人</th>	 
			<th>品名</th>	 
			<th>单价</th>	 
			<th>数量</th>
			<th>总价</th>
			<th>状态</th>
			 
		</tr>
		 <c:forEach items="${OrderList.data}" var="vo">   
		<tr>	 
			<td >${vo.userid}</td>
			<td >${vo.name}</td>
			<td >${vo.price}</td>
			<td >${vo.numbers}</td>
			<td >${vo.total}</td>
			<c:if test="${vo.state==1 }">
			<td style="color:green;">已支付</td>
			</c:if>
			<c:if test="${vo.state==0}">
			<td style="color:red;">未支付</td>
			</c:if>	
		</tr>
 		</c:forEach>
 		<c:if test="${OrderList.sp != null}">
		<tr>
			<td colspan="6">
				 
				<span>共${OrderList.sp.count}条记录</span>
				<span>共${OrderList.sp.totalpage}页</span>
				<span>第${OrderList.sp.page}页</span>
				
				<span  ><a
				href="${pageContext.request.contextPath}/servlets/Order.html?page=${OrderList.sp.firstPage}">首页</a></span>
				<span  ><a
				href="${pageContext.request.contextPath}/servlets/Order.html?page=${OrderList.sp.prePage}">上一页</a></span>
				<c:forEach items="${OrderList.sp.arrayPage}" var="index">  
				
				<span <c:if test="${index == OrderList.sp.page}">style="color:red;"</c:if> ><a href="${pageContext.request.contextPath}/servlets/Order.html?page=${index}">${index}</a></span>
			
				 </c:forEach>
				<span  ><a
				href="${pageContext.request.contextPath}/servlets/Order.html?page=${OrderList.sp.nextPage}">下一页</a></span>
				<span  ><a
				href="${pageContext.request.contextPath}/servlets/Order.html?page=${OrderList.sp.lastPage}">末页</a></span>
			</td>
		</tr>
		</c:if>
		<c:if test="${OrderList.sp == null}">
		<tr>	
			<td colspan="6">目前没有数据!</td>
		</tr>
		</c:if>
	</table>
	
 </body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值