aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes mock question regarding dynamic attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "mock question regarding dynamic attribute" Watch "mock question regarding dynamic attribute" New topic
Author

mock question regarding dynamic attribute

pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
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


SCJP 5.0(75%), SCWCD 5.0(88%)
Bk Jacky
Ranch Hand

Joined: Jun 11, 2005
Posts: 74
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.


SCJP1.4<br />SCWCD1.5<br />"Nothing is impossible"
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Do attributes implement DynamicAttributes ? Tags implement it, not attributes.


[My Blog]
All roads lead to JavaRanch
pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
yes ,you are right .
Thankx to clearify my doubt.
S Sravs
Ranch Hand

Joined: Feb 25, 2008
Posts: 85
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
Kram Nart
Ranch Hand

Joined: Jun 05, 2006
Posts: 32
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.


SCJP 5 <br /> SCWCD 5 <br /> SCBCD <br />
Figuring out what's next...
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Look again in the tutorial :
Kram Nart
Ranch Hand

Joined: Jun 05, 2006
Posts: 32
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

That's right !! They probably mixed DD with TLD.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mock question regarding dynamic attribute