JSP: accessing enum inside JSP EL tags
- by Arjun
My java enum looks like this:
public enum EmailType { HOME, WORK, MOBILE, CUSTOMER_SERVICE, OTHER }
In JSP, I am trying to do sth like below, which is not working.
<c:choose>
<c:when test="${email.type == EmailType.HOME}">(Home)</c:when>
<c:when test="${email.type == EmailType.WORK}">(Work)</c:when>
</c:choose>
After googling, I found these links: Enum inside a JSP. But, I want to avoid using scriplets in my JSP. How can I access the java enum inside EL tag and do the comparision?? Please help.