- For tag files, also put attributes in the wrapped jspContext.
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 1 Nov 2006 10:59:20 +0000 (10:59 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 1 Nov 2006 10:59:20 +0000 (10:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@469855 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/Generator.java

index 9aa9ed0..bcf0504 100644 (file)
@@ -3559,8 +3559,7 @@ class Generator {
             throws JasperException {
 
         if (tagInfo.hasDynamicAttributes()) {
-            out
-                    .printil("private java.util.HashMap _jspx_dynamic_attrs = new java.util.HashMap();");
+            out.printil("private java.util.HashMap _jspx_dynamic_attrs = new java.util.HashMap();");
         }
 
         // Declare attributes
@@ -3619,6 +3618,14 @@ class Generator {
                 out.print(" = ");
                 out.print(attrInfos[i].getName());
                 out.println(";");
+                if (ctxt.isTagFile()) {
+                    // Tag files should also set jspContext attributes
+                    out.printin("jspContext.setAttribute(\"");
+                    out.print(attrInfos[i].getName());
+                    out.print("\", ");
+                    out.print(attrInfos[i].getName());
+                    out.println(");");
+                }
                 out.popIndent();
                 out.printil("}");
                 out.println();