Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jsp. enum comparison / equality

Tags:

java

jsp

jstl

el

I have following jsp fragment:

                       <td class="">${campaign.moderated}
                            <c:if test="${campaign.moderated} == TRUE">
                                <a href="#">click me</a>
                            </c:if>
                        </td>

Campaign class:

public class Campaign {
      //...
      private ModerationStatus moderated;
      //get and set
}

ModerationStatus :

public enum ModerationStatus {
    TRUE,
    FALSE,
    IN_PROGRESS
}

I cannot achieve the situation when a tag will render on jsp.

what Do I wrong?

P.S.

This table cell looks like this:

enter image description here

like image 470
gstackoverflow Avatar asked Aug 23 '26 12:08

gstackoverflow


1 Answers

this works:

                          <c:if test="${campaign.moderated eq 'TRUE'}">
                                <a href="#">click me</a>
                            </c:if>
like image 185
gstackoverflow Avatar answered Aug 26 '26 03:08

gstackoverflow