• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL expression doubt

 
Asif
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%
int [] nums = {42,420,4200};
request.setAttribute("foo",nums);
%>
${requestScope['foo'][0] ne 10 div 0}

Ans:true

How ??
 
Xenon Parker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go by the BODMAS rules...
requestScope['foo'][0] ne 10 div 0

Here,
requestScope['foo'][0] is evaluated to 42
then
10 div 0 is evaluated to Infinity

now wats this - 42 not equals Infinity
Its TRUE
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Asif",
Please check your private messages regarding an important administrative matter.
-Ben
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic