my dog learned polymorphism*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt on Q 3 HFSJ chapter 10 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 "Doubt on Q 3 HFSJ chapter 10" Watch "Doubt on Q 3 HFSJ chapter 10" New topic

Doubt on Q 3 HFSJ chapter 10

muthu kumaran
Ranch Hand

Joined: Oct 26, 2004
Posts: 56
For Q 3 in chapter 10 (page 560), I feel that none of the answers are right


where tag1 - extends TagSupport
tag2 - extends SimpleTagSupport
tag3 - extends TagSupport

Now the answer for this question is given as Option C ,
which says

"Tag3 Handler may use the getParent method twice to gain access to the
instance of Tag1 Handler"

But Tag3 is a classic Tag whereas Tag2 is a Simple Tag. So our call to
getParent fails here itself , coz a classic Tag's getParent() returns a "Tag" interface , which is not implemented by a SimpleTag.

When the call fails here, how can we use getParent() twice to access Tag 1

Can anyone explain me why this option is specified as correct one ? :roll:
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Yes that question doesn't have any correct answer.

Check the Errata

Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
muthu kumaran
Ranch Hand

Joined: Oct 26, 2004
Posts: 56
oh..thanks vishnu
Consider Paul's rocket mass heater.
subject: Doubt on Q 3 HFSJ chapter 10
Similar Threads
Simple/Classic tag parent access
Custom tags Qn in K &B pg 560
HF chap.10 : don't understand answer for Q3
Doubt on Tag Handlers
SimpleTags + ClassicTags + getParent()