牛骨文教育服务平台(让学习变的简单)
博文笔记

EL表达式,分页 ,集合遍历

创建时间:2016-09-27 投稿人: 浏览次数:1863
                                               <span style="font-size:18px;"><strong>  EL表达式,分页 ,集合遍历</strong></span>
<%@ page language="java" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<HTML>
<head>
    <%@ include file="/WEB-INF/views/include/head.jsp" %>
    <%@ include file="/WEB-INF/views/include/jquery.jsp" %>
    <%@ include file="/WEB-INF/views/include/bootstrap.jsp" %>
    <%@ include file="/WEB-INF/views/include/picker.jsp" %>
    <link href="${ctx}/static/css/common.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div  align="center" style="margin-top: 50px">
    <p>我是主页 MyPage1111</p>
</div>
<div align="center">
    <input type="text" name="search" id="search">
</div>
<div>
<table border="1" align="center"  bgcolor="#f0ffff" width="60%">
    <tr>
        <td>用户id</td>
        <td>用户手机号</td>
        <td>用户密码</td>
        <td>用户地址</td>
        <td>用户头像</td>
        <td>删除</td>

    </tr>
<c:forEach items="${hospitalList}" var="hosipital">
    <tr>
        <td>${hosipital.id}</td>
        <td>${hosipital.hospitalName}</td>
        <td>${hosipital.hospitalAddress}</td>
        <td>${hosipital.isApprove}</td>
        <td><img src="${hosipital.hospitalIcon}"/></td>
        <td>   <a href="${ctx}/deleteUserById?userId=${hosipital.id}">修改</a></td>
    </tr>
</c:forEach>
<tr>

    <td>
        <a href="${ctx}/hospitallist?page=0&size=${requestScope.size}">首页</a>
    </td>
    <td>
        当前页 ${requestScope.page}
    </td>
    <td>
        <c:choose>
            <c:when test="${requestScope.page<requestScope.totalPage-1}">
                <a href="${ctx}/hospitallist?page=${requestScope.page+1}&size=${requestScope.size}">下一页${requestScope.page+1}</a>
            </c:when>

            <c:otherwise>
                下一页
            </c:otherwise>
        </c:choose>
    </td>

    <td>
        <c:choose>
            <c:when test="${requestScope.page>0}">
                <a href="${ctx}/hospitallist?page=${requestScope.page-1}&size=${requestScope.size}">上一页${requestScope.page-1}</a>
            </c:when>

            <c:otherwise>
                上一页
            </c:otherwise>
        </c:choose>
    </td>

    <td>
        <a href="${ctx}/hospitallist?page=${requestScope.totalPage-1}&size=${requestScope.size}">尾页${requestScope.totalPage-1}</a>
    </td>
</tr>
</table>

</div>
</body>
</html>

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。