This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread 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 Android Security Essentials Live Lessons this week in the Android 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
 
Similar Threads
Inorder traversal of a Binary Search Tree
protected variables
type ForTokensTag is not applicable for the arguments (Object)
JPA Mapping Exception
jstl access for obj.obj.member