- Always check the output folder when going in the compile method, to make sure it...
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 9 Sep 2006 23:22:05 +0000 (23:22 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 9 Sep 2006 23:22:05 +0000 (23:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@441879 13f79535-47bb-0310-9956-ffa450edef68

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

index 957221a..a72a72e 100644 (file)
@@ -606,6 +606,16 @@ public class JspCompilationContext {
 
     static Object outputDirLock = new Object();
 
+    public void checkOutputDir() {
+        if (outputDir != null) {
+            if (!(new File(outputDir)).exists()) {
+                makeOutputDir();
+            }
+        } else {
+            createOutputDir();
+        }
+    }
+        
     protected boolean makeOutputDir() {
         synchronized(outputDirLock) {
             File outDirFile = new File(outputDir);
index 048916f..0f40524 100644 (file)
@@ -130,6 +130,7 @@ public abstract class Compiler {
             pageInfo.setIncludeCoda(jspProperty.getIncludeCoda());
         }
 
+        ctxt.checkOutputDir();
         String javaFileName = ctxt.getServletJavaFileName();
         ServletWriter writer = null;