• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JSP EL clarification

 
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?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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.
 
Creator of Enthuware JWS+ V6
Posts: 3348
303
Android Eclipse IDE Chrome
  • 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.
 
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
 
What's gotten into you? Could it be this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic