You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by lu...@apache.org on 2003/03/27 02:36:19 UTC

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler PageDataImpl.java

luehe       2003/03/26 17:36:18

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        PageDataImpl.java
  Log:
  Fixed 18314: Multiple declarations of same taglib cause exception
  during validation
  
  Revision  Changes    Path
  1.26      +19 -10    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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- PageDataImpl.java	24 Mar 2003 21:36:05 -0000	1.25
  +++ PageDataImpl.java	27 Mar 2003 01:36:18 -0000	1.26
  @@ -187,13 +187,22 @@
   	    Attributes attrs = n.getAttributes();
   	    if (attrs != null) {
   		String type = "xmlns:" + attrs.getValue("prefix");
  -		String location = attrs.getValue("uri");
  -		if (location != null) {
  -		    rootAttrs.addAttribute("", "", type, "CDATA", location);
  -		} else {
  -		    location = attrs.getValue("tagdir");
  -		    rootAttrs.addAttribute("", "", type, "CDATA",
  -					   URN_JSPTAGDIR + location);
  +		/*
  +		 * 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(type) == -1) {
  +		    String location = attrs.getValue("uri");
  +		    if (location != null) {
  +			rootAttrs.addAttribute("", "", type, "CDATA",
  +					       location);
  +		    } else {
  +			location = attrs.getValue("tagdir");
  +			rootAttrs.addAttribute("", "", type, "CDATA",
  +					       URN_JSPTAGDIR + location);
  +		    }
   		}
   	    }
   	}
  
  
  

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