You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

86 lines
3.2 KiB

<!DOCTYPE html>
<html lang="en">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <!--输出,条件,迭代标签库-->
<%@ page pageEncoding="utf-8" %>
<head>
<c:import url="head.jsp"/>
</head>
<body>
<c:choose>
<c:when test="${datas.type=='success'}">
<form:form id="pageForm">
<c:import url="form.jsp"/>
<table class="table">
<thead>
<tr>
<th>cid</th>
<th>aid</th>
<th>title</th>
<th>subtitle</th>
<th>author</th>
</tr>
</thead>
<tbody>
<c:forEach items="${datas.datas}" var="data">
<tr>
<td>${data.cid}</td>
<td>${data.aid}</td>
<td>${data.title}</td>
<td>${data.subtitle}</td>
<td>${data.author}</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="row">
<div class="col-sm-6">
<p class="text-justify font-weight-bold">
Showing ${(datas.currentPage-1)*datas.pageSize+1} to ${datas.currentPage*datas.pageSize}
of ${datas.count} entries
</p>
</div>
<div class="col-sm-6">
<div id="pageButton" class="btn-toolbar justify-content-end" role="toolbar"
aria-label="Toolbar with button groups">
<div class="btn-group mr-2" role="group">
<button value="0" type="button" class="btn btn-secondary">首页</button>
<button value="${datas.currentPage-2}" type="button" class="btn btn-secondary"
<c:if test="${datas.currentPage-2==-1}">disabled</c:if>>上一页
</button>
<button value="${datas.currentPage}" type="button" class="btn btn-secondary"
<c:if test="${datas.currentPage==datas.pages}">disabled</c:if>>下一页
</button>
<button value="${datas.pages-1}" type="button" class="btn btn-secondary">尾页</button>
</div>
<div class="btn-group mr-2" role="group">
<c:forEach begin="${datas.currentPage+1}"
end="${datas.currentPage+9}" var="i">
<c:if test="${i<=datas.pages-1}">
<button value="${i}" type="button" class="btn btn-secondary">${i}</button>
</c:if>
</c:forEach>
</div>
</div>
</div>
</div>
</form:form>
</c:when>
<c:otherwise>
<div class="alert alert-danger text-center" role="alert">
${datas.errorMsg}
</div>
</c:otherwise>
</c:choose>
</body>
</html>