luehe 2003/03/26 17:52:08 Modified: jasper2/src/share/org/apache/jasper/compiler Tag: tomcat_4_branch PageDataImpl.java Log: Fixed 18314: Multiple declarations of same taglib cause exception during validation Revision Changes Path No revision No revision 1.3.2.1 +14 -7 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java Index: PageDataImpl.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -r1.3 -r1.3.2.1 --- PageDataImpl.java 17 May 2002 23:44:00 -0000 1.3 +++ PageDataImpl.java 27 Mar 2003 01:52:08 -0000 1.3.2.1 @@ -209,10 +209,17 @@ public void visit(Node.TaglibDirective n) throws JasperException { Attributes attrs = n.getAttributes(); if (attrs != null) { - String uri = attrs.getValue("uri"); - String prefix = attrs.getValue("prefix"); - rootAttrs.addAttribute("", "", "xmlns:" + prefix, "CDATA", - uri); + String qName = "xmlns:" + attrs.getValue("prefix"); + /* + * According to javadocs of org.xml.sax.helpers.AttributesImpl, + * the addAttribute method does not check to see if the + * specified attribute is already contained in the list: This + * is the application's responsibility! + */ + if (rootAttrs.getIndex(qName) == -1) { + rootAttrs.addAttribute("", "", qName, "CDATA", + attrs.getValue("uri")); + } } } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]