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

来源:互联网 发布:亿文网络 编辑:程序博客网 时间:2024/06/06 00:43
  1. <%@ page language="java" pageEncoding="utf-8" %>  
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>  
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">  
  4. <HTML>  
  5. <head>  
  6.     <%@ include file="/WEB-INF/views/include/head.jsp" %>  
  7.     <%@ include file="/WEB-INF/views/include/jquery.jsp" %>  
  8.     <%@ include file="/WEB-INF/views/include/bootstrap.jsp" %>  
  9.     <%@ include file="/WEB-INF/views/include/picker.jsp" %>  
  10.     <link href="${ctx}/static/css/common.css" rel="stylesheet" type="text/css"/>  
  11. </head>  
  12. <body>  
  13. <div  align="center" style="margin-top: 50px">  
  14.     <p>我是主页 MyPage1111</p>  
  15. </div>  
  16. <div align="center">  
  17.     <input type="text" name="search" id="search">  
  18. </div>  
  19. <div>  
  20. <table border="1" align="center"  bgcolor="#f0ffff" width="60%">  
  21.     <tr>  
  22.         <td>用户id</td>  
  23.         <td>用户手机号</td>  
  24.         <td>用户密码</td>  
  25.         <td>用户地址</td>  
  26.         <td>用户头像</td>  
  27.         <td>删除</td>  
  28.   
  29.     </tr>  
  30. <c:forEach items="${hospitalList}" var="hosipital">  
  31.     <tr>  
  32.         <td>${hosipital.id}</td>  
  33.         <td>${hosipital.hospitalName}</td>  
  34.         <td>${hosipital.hospitalAddress}</td>  
  35.         <td>${hosipital.isApprove}</td>  
  36.         <td><img src="${hosipital.hospitalIcon}"/></td>  
  37.         <td>   <a href="${ctx}/deleteUserById?userId=${hosipital.id}">修改</a></td>  
  38.     </tr>  
  39. </c:forEach>  
  40. <tr>  
  41.   
  42.     <td>  
  43.         <a href="${ctx}/hospitallist?page=0&size=${requestScope.size}">首页</a>  
  44.     </td>  
  45.     <td>  
  46.         当前页 ${requestScope.page}  
  47.     </td>  
  48.     <td>  
  49.         <c:choose>  
  50.             <c:when test="${requestScope.page<requestScope.totalPage-1}">  
  51.                 <a href="${ctx}/hospitallist?page=${requestScope.page+1}&size=${requestScope.size}">下一页${requestScope.page+1}</a>  
  52.             </c:when>  
  53.   
  54.             <c:otherwise>  
  55.                 下一页  
  56.             </c:otherwise>  
  57.         </c:choose>  
  58.     </td>  
  59.   
  60.     <td>  
  61.         <c:choose>  
  62.             <c:when test="${requestScope.page>0}">  
  63.                 <a href="${ctx}/hospitallist?page=${requestScope.page-1}&size=${requestScope.size}">上一页${requestScope.page-1}</a>  
  64.             </c:when>  
  65.   
  66.             <c:otherwise>  
  67.                 上一页  
  68.             </c:otherwise>  
  69.         </c:choose>  
  70.     </td>  
  71.   
  72.     <td>  
  73.         <a href="${ctx}/hospitallist?page=${requestScope.totalPage-1}&size=${requestScope.size}">尾页${requestScope.totalPage-1}</a>  
  74.     </td>  
  75. </tr>  
  76. </table>  
  77.   
  78. </div>  
  79. </body>  
  80. </html>  

0 0
原创粉丝点击