• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Question on Custom tags

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
He's giving us the slip! Quick! Grab this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic