wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL access operator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL access operator" Watch "EL access operator" New topic
Author

EL access operator

amarkirt saroay
Ranch Hand

Joined: Mar 16, 2008
Posts: 167
Is this true:


If the dot operator is used to access the bean property but the property does not exist ,then a runtime exception is thrown !


SCJP-75%
SCWCD-82%
Siphiwe Madi
Ranch Hand

Joined: Aug 16, 2007
Posts: 70
Hi,

The is only one way to find out. "Try it".

Regards,
Siphiwe Madi
[SCJP, __, __]
Next ... scwcd, scjwsd

Regards, Siphiwe Madi
[SCJP, SCWCD, __] Next ... scjwsd
Ravi Bansal
Ranch Hand

Joined: Aug 18, 2008
Posts: 84
it will return null and EL simply ignores null values........


SCJP 5.0 94%
OCE-EJBD 90%
Katrin Perry
Ranch Hand

Joined: Mar 07, 2007
Posts: 61
Hi,

If the bean doesn't exist (not found in any of the scopes) -> null, which is ignored and no Exception would be thrown.

If on the other hand the bean exists (it is found in one of the scopes), but you try to reference a property that doesn't exist an Exception would be thrown.

I hope that this helps.

Thanks
Katrin


Katrin
SCJP 5.0, SCWCD, SCBCD, Oracle Certified Master Enterprise Architect
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

Ravi Bansal wrote:it will return null and EL simply ignores null values........

Incorrect.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL access operator
 
Similar Threads
dot operator
True/False?
Doubt in Errata ; Thanks Cleared .
Bean Property-Dot Operator..
dot and [] operators in EL