tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1298794 - /tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
Date Fri, 09 Mar 2012 11:51:43 GMT
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


Mime
View raw message