Access Enum value using EL with JSTL

前端 未结 13 1870
迷失自我
迷失自我 2020-11-29 00:18

I have an Enum called Status defined as such:

public enum Status { 

    VALID(\"valid\"), OLD(\"old\");

    private final String val;

    Status(String va         


        
相关标签:
13条回答
  • 2020-11-29 00:53

    I generally consider it bad practice to mix java code into jsps/tag files. Using 'eq' should do the trick :

    <c:if test="${dp.Status eq 'OLD'}">
      ...
    </c:if>
    
    0 讨论(0)
提交回复
热议问题