horwat      01/04/19 16:43:17

  Modified:    jasper/src/share/org/apache/jasper/compiler
                        TagBeginGenerator.java
  Log:
  For example, in the jakarta-taglibs xsl tag:
  
  <xsl:apply xml="<%= xmlFile %>" xsl="<%= xslFile %>"/>
  
  A bug resulted when the first element value "<%= xmlFile %>" matched up with the 
first attribute's properties. In this case, it would have been "nameXml" as defined in 
the xsl.tld. "nameXml" has its rtexprvalue property set to false.
  
  The bug fix makes sure that attribute properties match up with the correct element.
  
  Bugzilla: #811
  
  Revision  Changes    Path
  1.9       +13 -6     
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagBeginGenerator.java
  
  Index: TagBeginGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TagBeginGenerator.java    2001/02/04 01:05:35     1.8
  +++ TagBeginGenerator.java    2001/04/19 23:43:17     1.9
  @@ -217,13 +217,20 @@
                   Class c[] = m.getParameterTypes();
                   // assert(c.length > 0)
   
  -                if (attributes[i].canBeRequestTime() && 
  -                        JspUtil.isExpression(attrValue, isXml)) {
  -                    attrValue = JspUtil.getExpr(attrValue, isXml);
  -                } else {
  -                    attrValue = convertString(c[0], attrValue, writer, attrName,
  -                                              tc.getPropertyEditorClass(attrName));
  +                // match tld defined attribute to its element value
  +                for(int j = 0; j < attributes.length; j++) {
  +                    if (attrs.getLocalName(i).equals(attributes[j].getName())) {
  +                        if (attributes[j].canBeRequestTime() && 
  +                            JspUtil.isExpression(attrValue, isXml)) {
  +                            attrValue = JspUtil.getExpr(attrValue, isXml);
  +                        } else {
  +                            attrValue = convertString(c[0], attrValue, writer, 
attrName,
  +                                                      
tc.getPropertyEditorClass(attrName));
  +                        }
  +                    }
                   }
  +
  +
                   writer.println(thVarName+"."+m.getName()+"("+attrValue+");");
               }
           }
  
  
  

Reply via email to