In JSP, I want to compare two variables
If I do:
<c:set var="pagerTotDisp" value="9"/>
<c:if test="${pagerTotDisp > 8}">
<span>pagerTotDisp above 8</span>
</c:if>
It displays "pagerTotDisp above 8" as expected
<c:set var="TotalPages" value="10"/>
<c:if test="${TotalPages > 2}">
<span>TotalPages above 2</span>
</c:if>
It displays "pagerTotDisp above 8" as expected
But then if I do
<c:set var="pagerTotDisp" value="9"/>
<c:set var="TotalPages" value="10"/>
<c:if test="${TotalPages < pagerTotDisp}">
<span>This condition is not true. This text should not be displayed</span>
</c:if>
It displays "This condition is not true. This text should not be displayed".
What's going on?
Is that JSP not being able to handle two variables in a same condition??
thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…