• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in a tag handler question

 
Mani Jagathesan
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic