zoukankan      html  css  js  c++  java
  • struts2 标签 和 c标签的页面数据显示

    用struts2 标签显示的页面代码

    <s:if test="#request.employees == null || #request.employees.size() == 0">
      没有任何员工信息
    </s:if>
    <s:else>
      <table border="1" cellpadding="10" cellspacing="0">
        <tr>
          <td>ID</td>
          <td>LASTNAME</td>
          <td>EMAIL</td>
          <td>BIRTH</td>
          <td>CREATETIME</td>
          <td>DEPT</td>
          <td>DELETE</td>
          <td>EDIT</td>
        </tr>
      <s:iterator value="#request.employees">
        <tr>
          <td>${id }</td>
          <td>${lastName }</td>
          <td>${email }</td>
          <td>
            <s:date name="birth" format="yyyy-MM-dd"/>
          </td>
          <td>
            <s:date name="createTime" format="yyyy-MM-dd hh:mm:ss"/>
          </td>
          <td>${department.departmentName }</td>
          <td>
            <a href="ajax/delete?id=${id}">Delete</a>
          </td>
          <td>
            <a href="emp-add?id=${id}">Edit</a>
          </td>
        </tr>
        </s:iterator>
      </table>
    </s:else>

    用jsp c标签显示的页面代码

    <c:if test="${empty requestScope.employees}">
      没有员工信息!
    </c:if>
    <c:if test="${!empty requestScope.employees}">
      <table border="1" cellpadding="10" cellspacing="0">
        <tr>
          <td>ID</td>
          <td>LastName</td>
          <td>Gender</td>
          <td>Department</td>
          <td>Edit</td>
          <td>Delete</td>
        </tr>
    <c:forEach items="${requestScope.employees}" var="emp">
        <tr>
          <td>${emp.id}</td>
          <td>${emp.lastName}</td>
          <td>${emp.gender == 0? '女':'男'}</td>
          <td>${emp.department.departmentName}</td>
          <td><a href="">Edit</a></td>
          <td><a href="">Delete</a></td>
        </tr>
    </c:forEach>
    </table>
    </c:if>

  • 相关阅读:
    web.xml配置详解
    oracle按时间创建分区表
    cron表达式详解
    临时表
    配置非安装版tomcat服务
    CodeForces 785 D Anton and School
    CodeForces 601B Lipshitz Sequence
    CodeForces 590C Three States BFS
    CodeForces 592D Super M DP
    CodeForces 507E Breaking Good 2维权重dij
  • 原文地址:https://www.cnblogs.com/yydeyi/p/4720940.html
Copyright © 2011-2022 走看看