Greetings,
 
The tag description defines the tag implementation interface that you want to expose to the JSPs.  If you don't include an attribute in the descriptor for a tag then the JSP translator won't allow it's use in a JSP.
 
I'll assume that it's your intention to use both attribute1 and attribute2 with your SpecificTag. 
<myTags:SpecificTag attribute1="..." attribute2="..."> ...
If so, then you must define your SpecificTag with both attributes.
 
If you have 99 other tags that all subclass from GenericTag, and you intend to use attribute1 with all those tags, then you'd have to define "attribute1" for each of those tags.
 
If you intend to NOT allow attribute1 to be set on SpecificTag within a JSP (perhaps you want to "hide" that attribute on SpecificTag and use it internally in the implementation of SpecificTag) then you would want to exclude it from your descriptor for SpecificTag.
 
 
 
BTW - I've run into this problem many times and have faced the same tedious redundancy.  If someone has a better solution, I'd appreciate hearing it.
 
-Lou Lembcke
 
-----Original Message-----
From: Craig Dickson [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 2:18 PM
To: jdjlist
Subject: [jdjlist] Inheiritance in JSP taglibs

Hi,
 
Lets say I have 2 JSP tag classes called GenericTag and SpecificTag, where SpecificTag extends GenericTag. GenericTag is never meant to be used directly in a page, and could perhaps be declared abstract.
 
GenericTag also has 1 attribute called "attribute1". Specific tag has one attribute called "attribute2". 
 
When declaring the SpecifcTag in my .tld file, do I need to list both attributes, or just attrribute2? The broader question is if I have 100 tags that extend GenericTag do I really have to redeclare "attribute1" 100 times?
 
Thanks.
 
---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk

Reply via email to