You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/03/09 12:51:43 UTC

svn commit: r1298794 - /tomcat/trunk/java/org/apache/jasper/compiler/Generator.java

Author: markt
Date: Fri Mar  9 11:51:42 2012
New Revision: 1298794

URL: http://svn.apache.org/viewvc?rev=1298794&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52776
Refactor the code so JspFragment.invoke cleans up after itself.
Patch provided by Karl von Randow.

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

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=1298794&r1=1298793&r2=1298794&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Fri Mar  9 11:51:42 2012
@@ -2132,9 +2132,6 @@ class Generator {
                 out.println(");");
             }
 
-            // Restore EL context
-            out.printil("jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class,getJspContext());");
-
             n.setEndJavaLine(out.getJavaLine());
         }
 
@@ -4221,6 +4218,7 @@ class Generator {
             out.printil("}");
             out.printil("try {");
             out.pushIndent();
+            out.printil("Object _jspx_saved_JspContext = this.jspContext.getELContext().getContext(javax.servlet.jsp.JspContext.class);");
             out.printil("this.jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class,this.jspContext);");
             out.printil("switch( this.discriminator ) {");
             out.pushIndent();
@@ -4233,6 +4231,10 @@ class Generator {
             }
             out.popIndent();
             out.printil("}"); // switch
+
+            // restore nested JspContext on ELContext
+            out.printil("jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class,_jspx_saved_JspContext);");
+
             out.popIndent();
             out.printil("}"); // try
             out.printil("catch( java.lang.Throwable e ) {");



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