This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Q17, Pg 432, HFS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Q17, Pg 432, HFS" Watch "Q17, Pg 432, HFS" New topic
Author

Q17, Pg 432, HFS

Nitish Bahadur
Ranch Hand

Joined: Aug 25, 2003
Posts: 118
Q. Which about EL access operators are true?
C. If the .(dot) operator is used to access a bean property but the property doesn't exist, then a runtime exception is thrown.

Can someone just validate this one?
Bharat Roy
Ranch Hand

Joined: Jul 01, 2004
Posts: 156
The answer is WRONG. Check out errata.

If the property doesn't exist, it gives no o/p.
[ February 03, 2005: Message edited by: Ankur Bhatt ]
sundar katluri
Greenhorn

Joined: Dec 14, 2004
Posts: 25
if the bean exist and property does not exist -- throws run time exception (at least in tomcat). I have seen several posts in this forum that says the above statement is correct and errata is wrong.
I am confused now !! which is one is right?I greatly appreciate HFS authors if they could clarify this doubt


Thanks
Nitish Bahadur
Ranch Hand

Joined: Aug 25, 2003
Posts: 118
Ankur,

Try creating a Person class with just firstName property, but in the EL access lastName, which does not exist in your class definition. What do you see?

Additionally, please refer to JSP 2.3.4 last paragraph of JSP 2.0 Specification.

Can I assume the errata is wrong?

~Cheers
Bharat Roy
Ranch Hand

Joined: Jul 01, 2004
Posts: 156
Originally posted by Nitish Bahadur:
Ankur,

Try creating a Person class with just firstName property, but in the EL access lastName, which does not exist in your class definition. What do you see?

Additionally, please refer to JSP 2.3.4 last paragraph of JSP 2.0 Specification.

Can I assume the errata is wrong?

~Cheers

Oh boy, it threw an exception. Errata IS wrong!! I am concuding that if the left side of dot in an EL is Map then it will not throw an exception but if its bean it will.

Guess book needs errata's errata
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Q17, Pg 432, HFS