JSP 2.0 Expression Language - Basic Comparisons


This example illustrates basic Expression Language comparisons. The following comparison operators are supported:
Numeric
EL Expression Result
${1 < 2} true
${1 lt 2} true
${1 > (4/2)} false
${1 > (4/2)} false
${4.0 >= 3} true
${4.0 ge 3} true
${4 <= 3} false
${4 le 3} false
${100.0 == 100} true
${100.0 eq 100} true
${(10*10) != 100} false
${(10*10) ne 100} false

Alphabetic
EL Expression Result
${'a' < 'b'} true
${'hip' > 'hit'} false
${'4' > 3} true