• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Question on tld

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
Please help me in the following 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 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?

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.


According to me only option 2) is correct, but the mock exam says that options 2)n 4) are correct and the explanation for option 4) it gives is:
Since the body-content is tagdependent, it must implement the BodyTag interface.

I dont know any such relation between body-content and BodyTag....
Anyone please correct me if i am wrong.

Thanks in advance.
 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Bhavna,

It�s 2 and 4.

2- because even if you have declared a tag with some bodycontent, there is no problem if you use a empty body content.

4- Because if your value for bodycontent is "tagdependent" it means that you shold probably need to read your buffer and treat it rather that just showing it (write in buffer).

Therefore, you would need to extend BodyTagSupport or implements BodyTag to be able to use (doInitBody and setBodyContent(bc) ) for this porpuse (treat the bodycontent from tag).

I Holp to help you!

cya!!
 
Bhavna Jharbade
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Felipe
Thanks for that explanation.
 
crispy bacon. crispy tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic