Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Study kit review Question doubt

 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are given a tag library that has a tag named printReport. This tag may
accept an attribute, department, which cannot take a dynamic value. Which
of the following are correct uses of this tag? (Select two)
a <mylib rintReport/>
b <mylib rintReport department="finance"/>
c <mylib rintReport attribute="department" value="finance"/>
d <mylib rintReport attribute="department"
attribute-value="finance"/>
e <mylib rintReport>
<jsp:attribute name="department" value="finance" />
</mylib rintReport>

I thought the answer is b and e but the book say a and b
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This tag may accept an attribute department, so "a" and "b" are correct.

About "e", there is no "value" attribute in the jsp:attribute action. You must use its body to set something. Like :
 
K Sanjeet
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think e is also correct since its just the same thing as b. So b and e look to be correct to me. Please correct me if I am wrong.
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Santou.It made sense to me :-)
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanjeetz,
Please reread my last post and you will see that the jsp:attribute tag has no "value" attribute.

Also, could you please check the ranch's Naming Policy and change your name accordingly ? Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic