File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL access operator" Watch "EL access operator" New topic

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 !

Siphiwe Madi
Ranch Hand

Joined: Aug 16, 2007
Posts: 70

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

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

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

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

SCJP 5.0 94%
Katrin Perry
Ranch Hand

Joined: Mar 07, 2007
Posts: 61

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.


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

Joined: Jan 10, 2002
Posts: 63869

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


[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: EL access operator
It's not a secret anymore!