• 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

customTags

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(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 ]
 
Anant Rao
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

Thanks
 
What's that smell? Hey, sniff this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic