【问题标题】:How to check content of field in JSP [duplicate]如何检查JSP中的字段内容[重复]
【发布时间】:2017-11-04 08:23:52
【问题描述】:

我有桌子:

<c:forEach var="employee" items="${employees}">
    <tr>
        <td>${employee.id}</td>
        <td>${employee.gender.gender}</td>
        <td>${employee.name}</td>
        <td>${employee.surname}</td>
        <c:if test="${employee.appointment.appointment eq NAVIGATOR}">//Checking value of field
            <td>${employee.appointment.appointment}</td>
        </c:if>
    </tr>
</c:forEach>

我想检查字段的值:

${employee.appointment.appointment}

怎么做?

【问题讨论】:

    标签: jsp jstl


    【解决方案1】:

    如果您要检查employee.appointment.appointment 的值实际上是NAVIGATOR,您需要将NAVIGATOR 放在“NAVIGATOR”之类的引号中。

    <c:if test="${employee.appointment.appointment eq 'NAVIGATOR'}">
          <td>${employee.appointment.appointment}</td>
    </c:if>
    

    【讨论】:

      猜你喜欢
      • 2017-06-27
      • 1970-01-01
      • 1970-01-01
      • 2017-08-03
      • 1970-01-01
      • 2011-04-21
      • 2014-06-16
      • 2019-02-21
      • 2013-04-19
      相关资源
      最近更新 更多