• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL problem

 
Simran Dass
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I could not understand the result of foll EL expressions :-


${ "7" < false } - true

${ "7" <= false } - true

${ "7" >= false } - false

${ "7" >= true } - false

${ "7" > true } - false


for relational operators the rule is -

"If one of them is a String coerce the other to String and compare lexically". How is this rule
applied to above expressions
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3165
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ASCII Values of numbers are lesser than that of the alphabets. So when they are compared lexically "7" comes before "false" or "true".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic