Win a copy of Spring Boot in Practice this week in the Spring 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:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Which options correctly pass two attributes to a custom tag ?

 
Ranch Hand
Posts: 47
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic