JSF EL Relational operators (Comparison)

Wednesday, 08 June 2011 13:35

Relational Operators


The relational operators are:

  • == and eq
  • != and ne
  • < and lt
  • > and gt
  • <= and le
  • >= and ge

The second versions of the last 4 operators are made available to avoid having to use�entity references in XML syntax and have the exact same behavior, i.e. < behaves the�same as lt and so on.

Relational operators examples

Expression Value
#{10<20} true
#{10 lt 20} true
#{1 > (4/2)} false
#{1 gt (4/2)} false
#{4.0 >= 3} true
#{4.0 ge 3} true
#{40 <= 30} false
#{40 le 30} false
#{10 == 10} true
#{100 eq 100} true
#{(5*20) != 100} false
#{(5*20) ne 100} false
#{'a' < 'b'} true
#{'4' > 3} true
Tags: true , false , operators , relational , exact , syntax , references , entity

Add comment


Security code
Refresh