Bug 33538

Summary: TagLibraryInfoImpl does not process <tag-file> elements correctly from JSP 2.0 TLDs
Product: Tomcat 5 Reporter: Rahul <akolkar>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.0.28   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Rahul 2005-02-12 19:24:57 UTC
The XML schema for JSP 2.0 TLDs [ http://java.sun.com/xml/ns/j2ee/web-
jsptaglibrary_2_0.xsd ] specifies that xsd:complexType tagFileType may have 
any number of example or tag-extension child elements.

Jasper2 does not ignore these elements while processing the TLDs (as it 
should) and incorrectly logs warnings.

Patch:

Index: TagLibraryInfoImpl.java
===================================================================
RCS file: /usr/local/cvsroot/apache/jakarta-tomcat-5.0.28-src/jakarta-tomcat-
jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
retrieving revision 1.1
diff -c -r1.1 TagLibraryInfoImpl.java
*** TagLibraryInfoImpl.java	12 Feb 2005 17:51:54 -0000	1.1
--- TagLibraryInfoImpl.java	12 Feb 2005 17:57:25 -0000
***************
*** 473,478 ****
--- 473,482 ----
                  name = child.getBody();
              } else if ("path".equals(tname)) {
                  path = child.getBody();
+             } else if ("example".equals(tname)) {
+                 // Ignore <example> element
+             } else if ("tag-extension".equals(tname)) {
+                 // Ignore <tag-extension> element
              } else {
                  if (log.isWarnEnabled()) {
                      log.warn(Localizer.getMessage(
Comment 1 Yoav Shapira 2005-03-23 16:41:59 UTC
Done for 5.5.9.  Thanks for submitting this patch.