• 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

Doubt in a tag handler question

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

In one of the JDiscuss.com mock exams, I had this question.

Consider the following description of a tag in a TLD:

<tag>
<name>SmilyTag</name>
<tag-class>com.enthuware.ctags.SmilyTag</tag-class>
<description>Replaces emotions 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?

Select 2 correct options.

a. It is an empty tag.
b. It may be used as an empty tag. < -- Correct
c. It must have a body.
d. It must implement BodyTag interface. < -- Correct
Explanation:Since the body-content is tagdependent, it must implement the BodyTag interface.
e. It may take an attribute named 'name'. But if present, its value must be dynamic.

My doubt: SimpleTags can also have <body-content> of tagdependent. I thought the only way we could tell what interface it implements is by actually looking at the class.

I thought, the second answer option for this question will be option C as tagdependent treats body-content as plain text.

Can the experts help me out please?

Thanks

Mani
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic