• 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>

  • 相关阅读:
    POJ1704 Georgia and Bob
    BZOJ1299 巧克力棒
    IPSec
    GRE协议
    L2TP协议
    AAA及Radius
    网络安全概论
    路由策略与引入
    BGP协议
    路由协议
  • 原文地址:https://www.cnblogs.com/yydeyi/p/4720940.html
Copyright © 2020-2023  润新知