JSP 2.0 Expression Language - Basic Comparisons
This example illustrates basic Expression Language comparisons.
The following comparison operators are supported:
- Less-than (< or lt)
- Greater-than (> or gt)
- Less-than-or-equal (<= or le)
- Greater-than-or-equal (>= or ge)
- Equal (== or eq)
- Not Equal (!= or ne)
Numeric
EL Expression |
Result |
\${1 < 2} |
${1 < 2} |
\${1 lt 2} |
${1 lt 2} |
\${1 > (4/2)} |
${1 > (4/2)} |
\${1 > (4/2)} |
${1 > (4/2)} |
\${4.0 >= 3} |
${4.0 >= 3} |
\${4.0 ge 3} |
${4.0 ge 3} |
\${4 <= 3} |
${4 <= 3} |
\${4 le 3} |
${4 le 3} |
\${100.0 == 100} |
${100.0 == 100} |
\${100.0 eq 100} |
${100.0 eq 100} |
\${(10*10) != 100} |
${(10*10) != 100} |
\${(10*10) ne 100} |
${(10*10) ne 100} |
Alphabetic
EL Expression |
Result |
\${'a' < 'b'} |
${'a' < 'b'} |
\${'hip' > 'hit'} |
${'hip' > 'hit'} |
\${'4' > 3} |
${'4' > 3} |