Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do EL Expression containing combination Arithmetic ,Logical, Relational Operators work ?

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


myBean is a bean created in request scope with value of testproperty as 33

I am unable to get How these El expression operate.

How to EL operator work left to right or viceversa if in an EL we have combination of Arithmetic ,Logical and Relational operators ?
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohitkumar gupta wrote:
How to EL operator work left to right or viceversa if in an EL we have combination of Arithmetic ,Logical and Relational operators ?


The same way you expect them to work in java code. The operator precedence is same as in java.

For example: ${5 + 3 lt 6} will work same way as: (5 + 3 < 6) in a java code.
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Piyush
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic