• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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: 3409
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
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic