• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on Tags

 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • 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.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hi Sharma,

Can you tell how you get the answers?


Thanks.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • 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
 
Ash More'
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic