tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Waldhoff, Rodney" <rwald...@us.britannica.com>
Subject dashes ('-') in custom tag names
Date Wed, 07 Mar 2001 22:49:52 GMT
Either I'm reading the spec wrong, or Jasper isn't treating these right.

In the JSP 1.1 spec
(ftp://ftp.java.sun.com/pub/jsp/11final-87721/jsp1_1-spec.pdf), Section
5.3.5 notes that the name element under the tag element has the following
model:

 <!ELEMENT name (#PCDATA) >
 #PCDATA ::= NMTOKEN

(The JSP 1.2 describes custom tag names essentially the same way.)

In the XML 1.0 specification, NMTOKEN (name token) is defined by the
following production:

 [7] Nmtoken  ::= (NameChar)+ 
 [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar |
Extender 

but when I create a custom tag like <eg:foo-bar/>, then Tomcat generates
source code like:

 _jspx_th_eg_foo-bar_0.setPageContext(pageContext);

which of course fails because '-' is not valid in a Java identifier.

(This is with "Tomcat Version 3.2 (final)", I haven't tried it 4.)

Assuming dashes are valid, the fix seems pretty trivial, but am I missing
something?  Should dashes be valid in tag names?  Colons (':')?

 - Rod

Mime
View raw message