• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL and numeric literals

 
JohnWilliam Fitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

Can anyone explain to me why this works...

${1 < 2}

...but this doesn't...

${not 1 < 2}

...?

In order to make the second one work, I have to put numeric literals in quotes like this...

${not '1' < '2'}

...but why?

Thanks in advance!
John

To make
 
Patel Chintan
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by JohnWilliam Fitz:
Hi.

Can anyone explain to me why this works...

${1 < 2}

...but this doesn't...

${not 1 < 2}

...?

In order to make the second one work, I have to put numeric literals in quotes like this...

${not '1' < '2'}

...but why?

Thanks in advance!
John

To make


Hi John,
I think this problem is because of operator precedence. You can try writing
${not (1 < 2)}.It may work.
For Information about EL in detail you can visit:
http://www.ibm.com/developerworks/java/library/j-jstl0211.html
 
JohnWilliam Fitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! You're absolutely right!
 
Patel Chintan
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by JohnWilliam Fitz:
Thanks! You're absolutely right!


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic