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

来源:互联网 发布:网络办公 编辑:程序博客网 时间:2024/06/06 02:09
                                               <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>

1 0