This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

mock question regarding dynamic attribute

 
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
65
Marks: 1 Which of the following statements are true?
Choose at least one answer.
a. Where an attribute implements DynamicAttributes it can be used without being declared in the deployment descriptor
b. Using classes that implement DynamicAttributes requires that they be declared in the deployment descriptor
c. The body of a simpleTag can be accessed using the getJspBody method
d. Simple tags cannot access their body content
e. the SimpleTag getJspBody method returns an object of type JspFragment
f. the SimpleTag getJspBody method returns an object of type JspBody



Answer is given b,c and e .But i want to know why a is wrong .I think we dont declare about dynamic attribute in DD but declare in .tld file.So a is also correct.Please correct me if i am wrong.



Source: Marcus mock exam 3
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a. Where an attribute implements DynamicAttributes it can be used without being declared in the deployment descriptor

I think above statement is incorrect.Attributes don't implement DynamicAttributes interface it is the tag hander class who implements this interface and accept dynamic attribute.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do attributes implement DynamicAttributes ? Tags implement it, not attributes.
 
pradeep singh
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes ,you are right .
Thankx to clearify my doubt.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Christophe Verre:
Do attributes implement DynamicAttributes ? Tags implement it, not attributes.



yeah
i too had same thought but not sure thanks for the clarification

Regards
Sravanthi
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, option (a) is clear, but why is option (b) valid?

I just read Bryan's tutorial and found nothing mentioned regarding entries in the DD, only TLD.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look again in the tutorial :
 
Kram Nart
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I double-checked, there's no mention of DD configuration for it.


The next step of this tutorial is to discuss how the <formTags:select> custom tag is declared in the TLD. Here is the relevant chunk of the TLD:

code:

<tag>
<name>select</name>
<tag-class>com.example.taglib.FormSelectTagHandler</tag-class>
<body-content>scriptless</body-content>
<description>
This tag constructs an HTML form 'select' tag. It also generates
the 'option' tags based on the set of items in a list passed in by
the optionsList tag attribute.
</description>
<attribute>
<name>optionsList</name>
<type>java.util.List</type>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>


 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's right !! They probably mixed DD with TLD.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! 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