• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP EL clarification

 
Mark heningen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looking for a clarification about the following code (I am testing few small problems, no ref.):


It gives false true
Shouldn’t be true true? And if I change < into eq then it gives true true. Is it because of scope? Can anyone explain this?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scriptlets variables are not visible to EL. EL has only access to scopes variables. The i and j being compared in EL are not the scriptlet i and j.
 
Mark heningen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:The i and j being compared in EL are not the scriptlet i and j.


${i eq j} returns true. does this mean that default for comparison is true?
and i haven't declare i and j anywhere else in the code.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2345
90
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

${i eq j} returns true. does this mean that default for comparison is true?

This is an example of null equals null and that is always true.

Regards,
Frits
 
Mark heningen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This is an example of null equals null and that is always true.


Thanks Frits.
i got it now.
 
Parth Twari
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in EL arithmetic unknown value is 0

and in logical expression in EL it is false

so when you say

{i<j}

you get

{0<0} - false

and when you say

{0==0} - true
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic