0

This is my code in jsp page...

<table class="table table-dark" style="margin-left:auto;margin-right:auto;width:auto;">
  <thead>
    <tr>
      <th>
        <font>Division Code</font>
      </th>
      <th>
        <font>Division Name</font>
      </th>
      <th>
        <font>Dealer Type</font>
      </th>
      <th>
        <font>Status</font>
      </th>

    </tr>
  </thead>
  <tbody>
    <c:forEach var="sts" items="${dealerStatus}">
      <tr>
        <td>${sts.divcode}</td>
        <td>${sts.divname}</td>
        <td>${sts.usertype}</td>
        <td>${sts.userstatus}
          <span class="glyphicon glyphicon-check"></span>
          <span class="glyphicon glyphicon-unchecked"></span>
        </td>
      </tr>
    </c:forEach>
  </tbody>
</table>

Below is the img of the table:

IMAGE OF TABLE

If the userstatus is active the checked icon should be displayed else unchecked icon should be displayed

My attempt:

<c:choose> 
    <c:when test="${userstatus == 'Y'}"> 
        <span class="glyphicon glyphicon-check"></span> 
    </c:when> 
    <c:when test="${userstatus == 'N'}"> 
        <span class="glyphicon glyphicon-unchecked"></span> 
    </c:when> 
    <c:otherwise>
        C         
    </c:otherwise> 
</c:choose>

So can any one assist me with this issue?

dale landry
  • 7,831
  • 2
  • 16
  • 28
Kavana NV
  • 11
  • 2
  • show your attempts. – Swati Jan 24 '21 at 15:19
  • Does this answer your question? [Default value on JSP custom-tag attribute](https://stackoverflow.com/questions/3136415/default-value-on-jsp-custom-tag-attribute) – Randy Casburn Jan 24 '21 at 15:22
  • @KavanaNV In the future, please add formatted code to your original question by editing the question instead of adding your attempted code to the comments. You can edit your question by clicking the `edit` button under your question, under the keywords and next to the word `link`, then add any relevant information including code to your question. – dale landry Jan 24 '21 at 16:16
  • Hi you said in question if `userstatus is active.` but you are checking for `Y` ? – Swati Jan 25 '21 at 03:52
  • Hii Swati. Active inactive status is indicating as 'Y' and 'N' in the table so based on Y or N in the table the specific icons needs to be displayed in the UI – Kavana NV Jan 27 '21 at 09:04

0 Answers0