• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Custom tags Qn in K &B pg 560

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Given a Jsp Page:
<my:tag1>
<my:tag2>
<my:tag3/>
<my:tag2>
<my:tag1>
TagHandler for tag1 extends TagSupport; tag2 -SimpleTagSupport; tag3 extends TagSupport

Answer given C ..
my doubt is custom tags cannot have a simple tag as a parent so how can tag3 get access to the tag1;
pls clarify...am i missing something??
or is it in the errata..i dont have any
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I do not have my book available right now. If you need a link to the errata we have one at the bottom of our ScwcdFaq!
 
vandu matcha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi marc..
thanks for the errata..but its not there in the errata...
ok..i will give the options for the above Qn..

A. Tag3Handler cannot access the instance of Tag1Handler because Simple tags donot support access to the tag parent.

B. Only Classic tags are considered in composing the parent/child tag hierarchy; therefore, Tag3Handler may use the getParent method only once to gain access to the instance of Tag1Handler

C. Tag3Handler may use the getParent method twice to gain access to the instance of Tag1Handler.

D.Only Body Tag handlers can access the parent/child tag hierarchy; therefore, Tag3Handler cannot gain access to the instance of Tag1Handler.


Ans given is C but i think it is A.
ofcourse simple tags can have custom/simple tags as parents but
custom tags cannot have simple parents..hence tag3 cannot gain access to tag2...
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, vandu,

custom tags cannot have simple parents..hence tag3 cannot gain access to tag2..



No, it is wrong. Please refer to HFSJ p540.

Classic tags can have Simple parents, but it takes a slight hack to make that work because you can't cast a SimpleTag to the Tag return value of the Tag interface getParent()

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please any one explain this in detail...

Regards,
krishna.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vandu matcha:
am i missing something??
or is it in the errata..i dont have any



Hi, Vandu

Actually, there is explaination within HFSJ errata:
[550] question 3;
Option C is invalid.
Unfortunately, that leaves us with a mock question that doesn't have a valid answer.
 
What's brown and sticky? ... a stick. Or a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic