Win a copy of Microservices Testing (Live Project) 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

Doubt on Tags

 
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following question is related to Tags from Enthuware.

You are given a tag library that has:
1. A tag named getMenu that takes an attribute 'subject' which can be a dynamic value.
2. A tag named getHeading that takes an attribute 'report'.
Which of the following are correct uses of this library?


Options

Select 3 correct options.

1.<myTL:getMenu subject="Finance"/>


2.<myTL:getMenu subject="<myTL:getHeading report=1/>"/>


3. <myTL:getMenu subject='<myTL:getHeading report="1"/>'/>


4. <% String subject="HR";%> <myTL:getMenu subject="<%=subject%>"/>


5. <myTL:getHeading report="2"/>

Please tell the correct answer and how it is?



Thanks in advance.
 
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first
fourth
and fifth.

by the way , you ask too many questions.
 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sharma,

Can you tell how you get the answers?


Thanks.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<myTL:getMenu subject="Finance"/>

ans: This is custom tag with one attribute and empty body.

<myTL:getMenu subject="<myTL:getHeading report=1/>"/>
ans:This is illegal because attribute value can't be another custom tag.
this can be el,jsp expression or string.

<myTL:getMenu subject='<myTL:getHeading report="1"/>'/>
ans: same as second. changing the quotes does not make difference.

<% String subject="HR";%> <myTL:getMenu subject="<%=subject%>"/>
ans: this is 100% legal because custom tag attributes' value can be jsp
expression or EL.

<myTL:getHeading report="2"/>
ans: This is custom tag with single empty body which rtexprvalue is true.

anything else sweat heart?

best regards,
omi
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well its good that she asks, i mean i would have been caught by surprise if i got a tag attribute which takes another tags. anyways omi clarified it quite well.
 
reply
    Bookmark Topic Watch Topic
  • New Topic