Forums Register Login

customTags

+Pie Number of slices to send: Send
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.

1. It is an empty tag.
2. It may be used as an empty tag.
3. It must have a body.
4. It must implement BodyTag interface.
5. It may take an attribute named 'name'. But if present, its value must be dynamic.

can anybody help with answers and why.

Thanks
Infyniti.
+Pie Number of slices to send: Send
(1) is certainly incorrect as you've got <body-content>tagdependent</body-content> and not <body-content>empty</body-content>.

(2) is correct - any tag may be empty (but those declared as body-content empty must be empty). All that happens is the body, which isn't even there, is never evaluated. Classic tags skip all the lifecycle methods relating to bodies if the tag is empty at translation time.

(3) is false - given that (2) is correct and it may be empty.

(4) is false - no-one said this had to be a BodyTag at all; for that matter it could equally well be a SimpleTag. The only difference is that for a simple tag the <body-content> value must not be JSP, and it isn't here, so that could work.

(5) "It may take an attribute called 'name'" is true, but the wording in the second sentence is dodgy: "its value must be dynamic". I don't agree - the fact that <rtexprvalue>true</rtexprvalue> is declared means that the tag attribute can accept a dynamic runtime expression, not that it must... In essence I suppose this last answer is correct, but I think "its value may be dynamic" would be more accurate.
[ April 28, 2006: Message edited by: Charles Lyons ]
+Pie Number of slices to send: Send
Thanks Charles thats really helpful and clear explanation.
In tag attributes:

If required is false :- attribute may or may not present
if required in true :- attribute is must

if rtexprvalue is true :- it may contain runtime expression or strings
if rtexprvalue is false :- it must not contain runtime expression.

Thanks
Infyniti.
[ April 28, 2006: Message edited by: infyniti molugu ]
+Pie Number of slices to send: Send
Hi,

The answer 4 is not correct. Please check this from another author.

Thanks
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 736 times.
Similar Threads
Custom Tag : Mock exam question doubt
body-content
Question on tld
SimpleTag vs BodyTag
TLD Doubt
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:45:15.