tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1675594 - in /tomcat/trunk/java/org/apache/jasper: JspCompilationContext.java servlet/JspServletWrapper.java
Date Thu, 23 Apr 2015 12:38:08 GMT
Author: markt
Date: Thu Apr 23 12:38:08 2015
New Revision: 1675594

URL: http://svn.apache.org/r1675594
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=57845
Ensure that when an updated class file is detected that the JspLoader that loaded the old
class file is cleared so a new JspLoader can load the new version of the class

Modified:
    tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java

Modified: tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java?rev=1675594&r1=1675593&r2=1675594&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java Thu Apr 23 12:38:08 2015
@@ -182,6 +182,11 @@ public class JspCompilationContext {
         return jspLoader;
     }
 
+    public void clearJspLoader() {
+        jspLoader = null;
+    }
+
+
     /** ---------- Input/Output  ---------- */
 
     /**

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=1675594&r1=1675593&r2=1675594&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java Thu Apr 23 12:38:08
2015
@@ -219,6 +219,13 @@ public class JspServletWrapper {
                 if (this.servletClassLastModifiedTime < lastModified) {
                     this.servletClassLastModifiedTime = lastModified;
                     reload = true;
+                    // Really need to unload the old class but can't do that. Do
+                    // the next best thing which is throw away the JspLoader so
+                    // a new loader will be created which will load the new
+                    // class.
+                    // TODO Are there inefficiencies between reload and the
+                    //      isOutDated() check?
+                    ctxt.clearJspLoader();
                 }
             }
         }



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


Mime
View raw message