Author: markt
Date: Wed Jun 3 22:12:13 2009
New Revision: 781604
URL: http://svn.apache.org/viewvc?rev=781604&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38197
Take account of jsp:attribute elements when naming tag pools
Modified:
tomcat/container/tc5.5.x/webapps/docs/changelog.xml
tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/Generator.java
Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=781604&r1=781603&r2=781604&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Wed Jun 3 22:12:13 2009
@@ -125,6 +125,10 @@
(markt)
</fix>
<fix>
+ <bug>38197</bug>: Fix tag pooling when tags are used with
jsp:attribute.
+ (markt)
+ </fix>
+ <fix>
<bug>45666</bug>: Fix infinite loop on include. Patch provided by Tom
Wadzinski. (markt)
</fix>
Modified:
tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/Generator.java
URL:
http://svn.apache.org/viewvc/tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/Generator.java?rev=781604&r1=781603&r2=781604&view=diff
==============================================================================
--- tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/Generator.java
(original)
+++ tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/Generator.java
Wed Jun 3 22:12:13 2009
@@ -41,6 +41,7 @@
import org.apache.jasper.Constants;
import org.apache.jasper.JasperException;
import org.apache.jasper.JspCompilationContext;
+import org.apache.jasper.compiler.Node.NamedAttribute;
import org.apache.jasper.runtime.JspRuntimeLibrary;
import org.xml.sax.Attributes;
@@ -233,6 +234,7 @@
n.getPrefix(),
n.getLocalName(),
n.getAttributes(),
+ n.getNamedAttributeNodes(),
n.hasEmptyBody());
n.setTagHandlerPoolName(name);
if (!names.contains(name)) {
@@ -252,15 +254,21 @@
String prefix,
String shortName,
Attributes attrs,
+ Node.Nodes namedAttrs,
boolean hasEmptyBody) {
String poolName = null;
poolName = "_jspx_tagPool_" + prefix + "_" + shortName;
if (attrs != null) {
- String[] attrNames = new String[attrs.getLength()];
+ String[] attrNames =
+ new String[attrs.getLength() + namedAttrs.size()];
for (int i = 0; i < attrNames.length; i++) {
attrNames[i] = attrs.getQName(i);
}
+ for (int i = 0; i < namedAttrs.size(); i++) {
+ attrNames[attrs.getLength() + i] =
+ ((NamedAttribute)
namedAttrs.getNode(i)).getQName();
+ }
Arrays.sort(attrNames, Collections.reverseOrder());
if (attrNames.length > 0) {
poolName = poolName + "&";
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]