1

I have table:

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

I want to check value of field:

${employee.appointment.appointment}

How to do it?

bsuart
  • 351
  • 1
  • 4
  • 24

1 Answers1

0

You would need to put the NAVIGATOR in quotes like 'NAVIGATOR', if you are checking for the value of the employee.appointment.appointment is actually NAVIGATOR.

<c:if test="${employee.appointment.appointment eq 'NAVIGATOR'}">
      <td>${employee.appointment.appointment}</td>
</c:if>
Uresh K
  • 1,136
  • 11
  • 16