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 dot 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 "dot operator" Watch "dot operator" New topic

dot operator

amarkirt saroay
Ranch Hand

Joined: Mar 16, 2008
Posts: 167
If the dot(.) operator is used to access a bean property but the property does not exist ,then a runtime exception is thrown . Is this statement correct?

Tripati Sahu

Joined: Jul 11, 2009
Posts: 25
can you please provide an example???
amarkirt saroay
Ranch Hand

Joined: Mar 16, 2008
Posts: 167
For example:

If there is a bean named customer and it has only one property say name but it does not have a property say age.
So ,
Will this EL throw a runtime exception?: ${customer.age} or ${customer["age"]}
Mateus Lucio
Ranch Hand

Joined: Jul 27, 2006
Posts: 60
Yes, an EL Exception will be thrown!

Since it's a bean object ${customer.age} it's like customer.getAge() but that method does not exists.

Studying ...
I agree. Here's the link:
subject: dot operator
It's not a secret anymore!