• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Another question???

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question ID :998339084328
You need to use a taglibrary and you have the following constraints:
taglib prefix : myfinance
tag name : tax
Mandatory Attribute : rate
Option Attribute : age
body : JSP
Which of the following statements are valid?

and the ans are
<myfinance:tax rate="28"/>***
<myfinance:tax age="28"/>
<myfinance:tax age="32" rate="28"/>***
<myfinance:tax rate="28">JSP</myfinance:tax>***
<myfinance:tax rate="28"><%=JSP%></myfinance:tax>

==============================================
why not the last as i think if body-content is JSP the last one would just be like "out.println(JSP)" so whats wrong in that???
getting real confused here...please help
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But it will say you...Undefined variable JSP
Raj Paul
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Taash!
I think that the <%=JSP%> will take a variable (JSP) & as it is not given if it is defined or not then this will give a error So maybe this is the reason??
 
taash mg
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys,
u r both right. it does give undefined variable JSP.guess i goofed up
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the "rtexpvalue" element by default is false, it specifies whether the element can take request time expression values. In the question, it does not say anything about it, so the attribute tax should not take any expression values, that's why the last answer is incorrect.
-yu chen
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<rtexprvalue> is for tag attributes not for tag body. Here <%=JSP%> will be interpreted as an jsp expression value for the body of the Tag.
So rtexprvalue is not coming into play to make a decision here.
Regards,
Maha Anna
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic