tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Börncke ...@applicate.de>
Subject AW: Multiple attributes within an element - Is this a legal thingto do?
Date Mon, 20 Oct 2003 13:56:16 GMT
Thanks for your reply.

>Sorry, from all my understanding, thats just not allowed in XML.


JSP looks like XML but is it required for JSP to exactly match
the XML restrictions?

At least multiple attributes work in Tomcat 4.1.12 quite fine.
If I use this feature(?) in our project, I am am not sure if 
this will create problems in future versions of Tomcat or other 
servlet containers. The JSP specification seems to be not
clear in this point (at least I found no statement concerning
this topic).

Frank


-----Ursprüngliche Nachricht-----
Von: Mark R. Diggory [mailto:mdiggory@latte.harvard.edu]
Gesendet: Montag, 20. Oktober 2003 15:48
An: Tag Libraries Users List
Betreff: Re: Multiple attributes within an element - Is this a
legal
thingto do?


Sorry, from all my understanding, thats just not allowed in XML. 
Attributes always have to be unique keys. When trying to build
"sets" on 
a "key" I would recommend separate nested tags

<x:DEFINESET>
     <x:ELEMENT val="x"/>
     <x:ELEMENT val="y"/>
     <x:ELEMENT val="z"/>
</x:DEFINESET>

You can make a "public Collection getDefineset()" method in the 
DEFINESET tag. Then, in the ELEMENT jsp tag class you can lookup
its 
parent (DEFINESET) and call this method to get the Collection of 
definitions and add any new ELEMENTS to it.

hope this helps some,
MArk

Frank Börncke wrote:
> Hello,
> 
> defining a custom tag "DEFINESET" in a taglib having an
> attribute called ELEMENT we want to use this attribute
> multiple times as follows:
> 
> <x:DEFINESET
>    ELEMENT = "x"
>    ELEMENT = "y"   
>    ELEMENT = "z"
> />
> 
> Deployed in a Tomcat environment this results in multiple
> calls of the setter 'setELEMENT'. This allows us to collect
> the elements in e.g. a HashSet.
> 
> Is this multiple usage of an attribute a legal thing to do?
> Or is an attribute expected to be used only once in an element
> context? I did not find any information concerning this topic.
> 
> Will this work in other servlet containers too?
> 
> 
> Thanks in advance,
> 
> Frank Börncke
> 
> ______________________________________________________
> <applicate>, Hermann-Lingg-Str. 15, D-80336 München 
> frank.boerncke@applicate.de    -    www.applicate.de 
> Fon: + 49 (89) 54 47 9 48 2   oder   0700-APPLICATE 
> Fax: + 49 (89) 54 47 9 48 9 
>  
> 
> ______________________________________________________
> <applicate>, Hermann-Lingg-Str. 15, D-80336 München 
> frank.boerncke@applicate.de    -    www.applicate.de 
> Fon: + 49 (89) 54 47 9 48 2   oder   0700-APPLICATE 
> Fax: + 49 (89) 54 47 9 48 9 
>  
> 
>
-----------------------------------------------------------------
----
> To unsubscribe, e-mail:
taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
taglibs-user-help@jakarta.apache.org
> 

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu


-----------------------------------------------------------------
----
To unsubscribe, e-mail:
taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail:
taglibs-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message