luehe 2002/09/05 17:15:32 Modified: jasper2/src/share/org/apache/jasper/compiler Generator.java Node.java Validator.java Log: Fixed 12343: Dynamic Attributes specified via jsp:attribute not recognized if specified as body content Revision Changes Path 1.91 +5 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.90 retrieving revision 1.91 diff -u -r1.90 -r1.91 --- Generator.java 5 Sep 2002 11:27:19 -0000 1.90 +++ Generator.java 6 Sep 2002 00:15:32 -0000 1.91 @@ -2515,7 +2515,8 @@ if (attrs[i].isExpression()) { // Do nothing } else if (attrs[i].isNamedAttribute()) { - if (!n.checkIfAttributeIsJspFragment(attrs[i].getName())) { + if (!n.checkIfAttributeIsJspFragment(attrs[i].getName()) + && !attrs[i].isDynamic()) { attrValue = convertString( c[0], attrValue, attrName, handlerInfo.getPropertyEditorClass(attrName), 1.33 +10 -10 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java Index: Node.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- Node.java 4 Sep 2002 23:45:29 -0000 1.32 +++ Node.java 6 Sep 2002 00:15:32 -0000 1.33 @@ -1380,7 +1380,7 @@ public static class JspAttribute { - private String name; + private String qName; private String uri; private String localName; private String value; @@ -1393,9 +1393,9 @@ // The node in the parse tree for the NamedAttribute private NamedAttribute namedAttributeNode; - JspAttribute(String name, String uri, String localName, String value, + JspAttribute(String qName, String uri, String localName, String value, boolean expr, boolean el, boolean dyn ) { - this.name = name; + this.qName = qName; this.uri = uri; this.localName = localName; this.value = value; @@ -1411,9 +1411,9 @@ * named attribute. In this case, we have to store the nodes of * the body of the attribute. */ - JspAttribute( String name, NamedAttribute namedAttributeNode, - boolean dyn ) { - this.name = name; + JspAttribute(NamedAttribute namedAttributeNode, boolean dyn) { + this.qName = namedAttributeNode.getName(); + this.localName = this.qName; this.value = null; this.namedAttributeNode = namedAttributeNode; this.expression = false; @@ -1426,7 +1426,7 @@ * @return The name of the attribute */ public String getName() { - return name; + return qName; } /** 1.35 +7 -7 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java Index: Validator.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- Validator.java 4 Sep 2002 22:54:54 -0000 1.34 +++ Validator.java 6 Sep 2002 00:15:32 -0000 1.35 @@ -757,7 +757,7 @@ for (int j=0; j<tldAttrs.length; j++) { if (na.getName().equals(tldAttrs[j].getName())) { jspAttrs[attrs.getLength() + i] - = new Node.JspAttribute(na.getName(), na, false); + = new Node.JspAttribute(na, false); tagDataAttrs.put(na.getName(), TagData.REQUEST_TIME_VALUE); found = true; @@ -767,7 +767,7 @@ if (!found) { if (tagInfo.hasDynamicAttributes()) { jspAttrs[attrs.getLength() + i] - = new Node.JspAttribute(na.getName(), na, true); + = new Node.JspAttribute(na, true); } else { err.jspError(n, "jsp.error.bad_attribute", na.getName()); @@ -816,7 +816,7 @@ nameSpecified = true; } jspAttrs[attrs.getLength() + i] - = new Node.JspAttribute(na.getName(), na, false); + = new Node.JspAttribute(na, false); } if (!nameSpecified) { @@ -908,7 +908,7 @@ Node.NamedAttribute namedAttributeNode = n.getNamedAttributeNode( qName ); if( namedAttributeNode != null ) { - result = new Node.JspAttribute(qName, namedAttributeNode, + result = new Node.JspAttribute(namedAttributeNode, dynamic); } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>