• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on Custom tags

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

This is a question from Enthuware.

Consider the following description of a tag in a TLD:

<tag>
<name>SmilyTag</name>
<tag-class>com.enthuware.ctags.SmilyTag</tag-class>
<description>
Replaces emoticons such as , , and with images.
</description>
<body-content>tagdependent</body-content>
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>

Which of the following statements regarding the above tag are correct?

a) It is an empty tag
b) It may be used as an empty tag.
c) It must have a body.
d) It must implement BodyTag interface.
e) It may take an attribute named 'name'. But if present, its value must be dynamic.

One of the correct answer is (d). and the explanation given is:
Since the body-content is tagdependent, it must implement the BodyTag interface.

Can any body explain this..I read HFSJ 1st edition two times but i think there is nothing mentioned that if bod-content is tagdepenedent it must implement BodyTag interface
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the answer is wrong because a Simple Tag can define a tagdependent body too
 
sudhakar karnati
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The correct answers given for this are:

b) It may be used as an empty tag.
d) It must implement BodyTag interface.

What are the correct options for this question?

Thanks & Regards,
Sudhakar Karnati
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is correct option:
b)It may be used as an empty tag.

But option d should not be correct choice for this ,as we can define a "tagdependent" as a body-content in case of simpleTaghandler as well.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic