This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

attribute tag v/s attribute directive

 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If <attribute> tag (child of <tag> given in the tld and <@ attribute> directive given in the tagFiles are same then why there default value of <rtexpervalue> is different.

FYI

Page No. 470 HFS:-> default value of <rtexpervalue> of <attribute> is false
Syntex card :->default value of <rtexpervalue> of <@ attribute> is true
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If <attribute> tag (child of <tag> given in the tld) and <@ attribute> directive given in the tagFiles are same then why their default value <rtexpervalue> is different.


What makes you think <attribute> sub-element of tag element and <%@ attribute %> Directive(applicable only within Tag Files) are same.
 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per my understanding the purpsoe of both is same that is to specify the attributes but we are not defining anything in the tld for tag files so we can not understand if the tag file is having any attribute or not so to avoid this confusion we specify one attribute directive in the tag file. Can you tell me the why they are not same?

-Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why tag files ?

From spec:
-----------
Tag files allow a JSP page author to create tag libraries using JSP syntax. This
means that page authors no longer need to know Java or ask someone who knows
Java to write a tag extension. Even for page authors or tag library developers who
know Java, writing tag files is more convenient when developing tags that
primarily output template text.
-----------

What I suppose :

1. Setting rtexprvalue's default value to 'true' will probably make it easier for page authors to make such files. They won't have to worry about it. "Gosh, why is my scriptlet not working ? Damn tag files"

2. Leaving the TLD's attribute default to false could be backward compatibility stuff ?

Maybe some dirty trick by the spec designers
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

As per my understanding the purpose of both is same that is to specify the attributes


YES you are correct. Purpose is same. I thought you got confused with syntax part.

Ok. You got to agree with the fact that Tag Files are included in JSP 2.0. Which means a more refined form. Hence the Spec developers should have thought rtexprvalue should be defaulted to true to make the programmer's life simpler by NOT having to specify THIS attribute in the attribute Directive(reduces extra code) and mark it as true if the attribute takes a dynamic input.

Excerpt from JSP 2.0 Spec Page:219

rtexprvalue
(optional) Whether the attribute�s value may be dynamically
calculated at runtime by a scriptlet expression. Unlike the corresponding TLD element, this attribute defaults to true.
 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satou and Vishnu for your valuable time and comments.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic