wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Another question??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Another question???" Watch "Another question???" New topic
Author

Another question???

taash mg
Ranch Hand

Joined: Mar 22, 2002
Posts: 106
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


Cheers<p>Taash<br />SCJP2
Raj Paul
Ranch Hand

Joined: Jul 09, 2002
Posts: 77
But it will say you...Undefined variable JSP
Raj Paul
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
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

Joined: Mar 22, 2002
Posts: 106
Thanks guys,
u r both right. it does give undefined variable JSP.guess i goofed up
Yu Chen
Greenhorn

Joined: Dec 03, 2001
Posts: 28
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


SCJP2<br />SCWCD
Maha Annadurai
Ranch Hand

Joined: Oct 27, 2002
Posts: 87
<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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Another question???