You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2006/09/19 16:37:50 UTC

svn commit: r447864 - /tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java

Author: remm
Date: Tue Sep 19 07:37:49 2006
New Revision: 447864

URL: http://svn.apache.org/viewvc?view=rev&rev=447864
Log:
- Ok, I'm not too sure about that one.
- Reset properly the ELContext associated JspContext when dealing with tag files.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java?view=diff&rev=447864&r1=447863&r2=447864
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java Tue Sep 19 07:37:49 2006
@@ -2001,8 +2001,7 @@
 
             // Copy virtual page scope of tag file to page scope of invoking
             // page
-            out
-                    .printil("((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();");
+            out.printil("((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();");
             String varReaderAttr = n.getTextAttribute("varReader");
             String varAttr = n.getTextAttribute("var");
             if (varReaderAttr != null || varAttr != null) {
@@ -2027,8 +2026,7 @@
                 out.printin("_jspx_page_context.setAttribute(");
                 if (varReaderAttr != null) {
                     out.print(quote(varReaderAttr));
-                    out
-                            .print(", new java.io.StringReader(_jspx_sout.toString())");
+                    out.print(", new java.io.StringReader(_jspx_sout.toString())");
                 } else {
                     out.print(quote(varAttr));
                     out.print(", _jspx_sout.toString()");
@@ -2040,6 +2038,9 @@
                 out.println(");");
             }
 
+            // Restore EL context
+            out.printil("jspContext.getELContext().putContext(JspContext.class,getJspContext());");
+
             n.setEndJavaLine(out.getJavaLine());
         }
 
@@ -2049,8 +2050,7 @@
 
             // Copy virtual page scope of tag file to page scope of invoking
             // page
-            out
-                    .printil("((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();");
+            out.printil("((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();");
 
             // Invoke body
             String varReaderAttr = n.getTextAttribute("varReader");
@@ -2084,6 +2084,9 @@
                 out.println(");");
             }
 
+            // Restore EL context
+            out.printil("jspContext.getELContext().putContext(JspContext.class,getJspContext());");
+
             n.setEndJavaLine(out.getJavaLine());
         }
 
@@ -3518,10 +3521,9 @@
         }
         
         // restore nested JspContext on ELContext
-        out.printil("jspContext.getELContext().putContext(JspContext.class,getJspContext());");
+        out.printil("jspContext.getELContext().putContext(JspContext.class,super.getJspContext());");
         
-        out
-                .printil("((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();");
+        out.printil("((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();");
         if (isPoolingEnabled && !tagHandlerPoolNames.isEmpty()) {
             out.printil("_jspDestroy();");
         }
@@ -4095,6 +4097,7 @@
             out.printil("}");
             out.printil("try {");
             out.pushIndent();
+            out.printil("this.jspContext.getELContext().putContext(JspContext.class,this.jspContext);");
             out.printil("switch( this.discriminator ) {");
             out.pushIndent();
             for (int i = 0; i < fragments.size(); i++) {



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