• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL confusion

 
uday ogra
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey can anybody tell why ${a div 4} evaluates to 0.0(perhaps EL treats a as unknown and give it default 0 value) and ${"a" div 4} produces a compilation error?
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A unknown value will be evaluated to 0 see the following post

Null will be evaluted to 0

And the division 0 div 4 will be 0.0 see the following post

http://www.coderanch.com/t/175303/java-Web-Component-SCWCD/certification/output-why-not25/5 = 5.0

I hope this helps,
[ July 07, 2007: Message edited by: Remko Strating ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic