Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SimpleTag vs BodyTag

 
Shiang Wang
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another question in jdiscuss.com. I think the answer should be one : B.
The correct answers on the website are B and D. I don't think D is right, since you can also implement SimpleTag or IteratorTag. Can someone confirm my thought?


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?


Options

Select 2 correct options.

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.



Thanks
 
jack wu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your custom tag must modify body content, extend the BodyTagSupport class. It implements BodyTag
 
Shiang Wang
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also implement SimpleTag or extend SimpleTagSupport to accomplish that, right ? It is the 'must' word in D that I am worrying about.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic