Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41606
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 27 Mar 2009 09:42:47 +0000 (09:42 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 27 Mar 2009 09:42:47 +0000 (09:42 +0000)
Prevent double init() of JSP
Patch provided by Chris Halstead

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@759074 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/Compiler.java

index 397f0c7..a6afd04 100644 (file)
@@ -332,6 +332,15 @@ public abstract class Compiler {
             String[] smap = generateJava();
             if (compileClass) {
                 generateClass(smap);
+                // Fix for bugzilla 41606
+                // Set JspServletWrapper.servletClassLastModifiedTime after successful compile
+                String targetFileName = ctxt.getClassFileName();
+                if (targetFileName != null) {
+                    File targetFile = new File(targetFileName);
+                    if (targetFile.exists() && jsw != null) {
+                        jsw.setServletClassLastModifiedTime(targetFile.lastModified());
+                    }
+                }
             }
         } finally {
             if (tfp != null && ctxt.isPrototypeMode()) {