• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP EL clarification

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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



Thanks Frits.
i got it now.
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic