posted 18 years ago
Hi
For Q 3 in chapter 10 (page 560), I feel that none of the answers are right
Question
<my:tag1>
<my:tag2>
<my:tag3/>
<my:tag2>
<my:tag1>
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: