aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSP EL clarification Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JSP EL clarification" Watch "JSP EL clarification" New topic
Author

JSP EL clarification

Mark heningen
Greenhorn

Joined: Mar 25, 2010
Posts: 25
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Mark heningen
Greenhorn

Joined: Mar 25, 2010
Posts: 25
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
Bartender

Joined: Apr 07, 2010
Posts: 1733
    
  25

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

Joined: Mar 25, 2010
Posts: 25

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


Thanks Frits.
i got it now.
Parth Twari
Ranch Hand

Joined: Jan 20, 2010
Posts: 163
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


Parth Tiwari
| Pursuing Bachelor of Engineering | OSUM Club Leader | SCJP 6 | SCWCD 5 |...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP EL clarification