I'm having a problem with JSTL.
I'm trying to compare a number inside JSTL and I'm struggling to get the result right:
(menu.TipoMenu is of Integer type but the tests with int, long and BigDecimal were had all the same result)
This doesn't work (always false)
<c:if test="#{ menu.tipoMenu.compareTo(2) eq 0 }">ok</c:if>
This is always false
<c:if test="#{ menu.tipoMenu.compareTo(2) eq 0 }" var="result"/>
#{result}
But, using JSF tags, all is bright :)
This renders ok
And this shows true or false, depending on the case
<h:outputText value="#{ menu.tipoMenu.compareTo(2) eq 0 }" />
I'm using .compareTo but I tried using == with int and long (and also with Integer at some point).
The point is that the expression evaluates ok in JSF tags but not in JSTL.
What could I be doing wrong?