This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new ca3c961f58 Mark the JSP wrapper for reload after a compilation
ca3c961f58 is described below

commit ca3c961f583dd5afd6ba965097f43e49da0f3e84
Author: remm <r...@apache.org>
AuthorDate: Tue May 20 16:28:30 2025 +0200

    Mark the JSP wrapper for reload after a compilation
    
    Previously a failed compilation after a change could lead to a reuse of
    the wrapper without reloading it.
    BZ69696.
---
 java/org/apache/jasper/JspCompilationContext.java | 3 ++-
 webapps/docs/changelog.xml                        | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/jasper/JspCompilationContext.java 
b/java/org/apache/jasper/JspCompilationContext.java
index 9eb8d8f307..b17446baa8 100644
--- a/java/org/apache/jasper/JspCompilationContext.java
+++ b/java/org/apache/jasper/JspCompilationContext.java
@@ -590,7 +590,6 @@ public class JspCompilationContext {
                 jspCompiler.removeGeneratedFiles();
                 jspLoader = null;
                 jspCompiler.compile();
-                jsw.setReload(true);
                 jsw.setCompilationException(null);
             } catch (JasperException ex) {
                 // Cache compilation exception
@@ -608,6 +607,8 @@ public class JspCompilationContext {
                 // Cache compilation exception
                 jsw.setCompilationException(je);
                 throw je;
+            } finally {
+                jsw.setReload(true);
             }
         }
     }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5312b9cee8..c00031277d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Jasper">
+    <changelog>
+      <fix>
+        <bug>69696</bug>: Mark the JSP wrapper for reload after a failed
+        compilation. (remm)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Web applications">
     <changelog>
       <fix>


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

Reply via email to