• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which options correctly pass two attributes to a custom tag ?

 
Kosala W.Abayagunawardene
Ranch Hand
Posts: 47
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this question on enthuware Question ID: 1077656812758
Which of the following options correctly pass two attributes to a custom tag?

Select 3 correct options
a <prefix:sometag 'val1' 'val2' />


b <prefix:sometag ${'val1'} ${'val2'} />


c <prefix:sometag attrA='val1' attrB='val2' />


d <prefix:sometag attrA=${"val1"} attrB=${"val2"} />


e <prefix:sometag>
<jsp:attribute name='attrA' value='val1' />
<jsp:attribute name='attrB' value='val2' />
</prefix:sometag>


f <prefix:sometag>
<jsp:attribute name='attrA'>val1</jsp:attribute>
<jsp:attribute name='attrB'>val2</jsp:attribute>
</prefix:sometag>

Answers are given as c,d,and f.

could someone please explain each answer in detail as it is bit confusing to me.(ASAP)Thanks
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can pass data to the tag handler in the form of attributes which are processed by the tag handler and do whatever it wants. Ther's only a syntax difference between them. <jsp:attribute> It's just another way of setting attributes in a tag instead of directly putting them inside the tag (as with c & d options). Also <jsp:attribute> has the advantage of place itself in the body even the body content for that tag is declared to be empty.
 
Kosala W.Abayagunawardene
Ranch Hand
Posts: 47
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha Kumara wrote:You can pass data to the tag handler in the form of attributes which are processed by the tag handler and do whatever it wants. Ther's only a syntax difference between them. <jsp:attribute> It's just another way of setting attributes in a tag instead of directly putting them inside the tag (as with c & d options). Also <jsp:attribute> has the advantage of place itself in the body even the body content for that tag is declared to be empty.



thanks for that
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic