You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/09/21 10:53:50 UTC

[tomcat] branch main updated: Fix BZ 66203. Log error message when JSP output dir can't be created

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

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new eba473f4d6 Fix BZ 66203. Log error message when JSP output dir can't be created
eba473f4d6 is described below

commit eba473f4d6f0ec3ee35da9aebf510790caaa0587
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Sep 21 11:48:28 2022 +0100

    Fix BZ 66203. Log error message when JSP output dir can't be created
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=66203
---
 java/org/apache/jasper/JspCompilationContext.java        | 4 ++--
 java/org/apache/jasper/resources/LocalStrings.properties | 3 ++-
 webapps/docs/changelog.xml                               | 8 ++++++++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/JspCompilationContext.java b/java/org/apache/jasper/JspCompilationContext.java
index 69a61b4477..69381ac7c6 100644
--- a/java/org/apache/jasper/JspCompilationContext.java
+++ b/java/org/apache/jasper/JspCompilationContext.java
@@ -689,9 +689,9 @@ public class JspCompilationContext {
         try {
             File base = options.getScratchDir();
             baseUrl = base.toURI().toURL();
-            outputDir = base.getAbsolutePath() + File.separator + path +
-                    File.separator;
+            outputDir = base.getAbsolutePath() + File.separator + path + File.separator;
             if (!makeOutputDir()) {
+                log.error(Localizer.getMessage("jsp.error.outputfolder.detail", outputDir));
                 throw new IllegalStateException(Localizer.getMessage("jsp.error.outputfolder"));
             }
         } catch (MalformedURLException e) {
diff --git a/java/org/apache/jasper/resources/LocalStrings.properties b/java/org/apache/jasper/resources/LocalStrings.properties
index aba19e3c71..35c192f240 100644
--- a/java/org/apache/jasper/resources/LocalStrings.properties
+++ b/java/org/apache/jasper/resources/LocalStrings.properties
@@ -138,7 +138,8 @@ jsp.error.noInstanceManager=No org.apache.tomcat.InstanceManager set in ServletC
 jsp.error.non_null_tei_and_var_subelems=Tag [{0}] has one or more variable subelements and a TagExtraInfo class that returns one or more VariableInfo
 jsp.error.not.in.template=[{0}] not allowed in a template text body.
 jsp.error.nullArgument=Null argument
-jsp.error.outputfolder=No output folder
+jsp.error.outputfolder=No output directory
+jsp.error.outputfolder.detail=Unable to create output directory [{0}] required for JSP compilation
 jsp.error.overflow=Error: JSP Buffer overflow
 jsp.error.page.conflict.autoflush=Page directive: illegal to have multiple occurrences of ''autoFlush'' with different values (old: [{0}], new: [{1}])
 jsp.error.page.conflict.buffer=Page directive: illegal to have multiple occurrences of ''buffer'' with different values (old: [{0}], new: [{1}])
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 372388eae6..7205c26e86 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -112,6 +112,14 @@
       </update>
     </changelog>
   </subsection>
+  <subsection name="Jasper">
+    <changelog>
+      <add>
+        <bug>66203</bug>: Log an error message when the JSP compiler is unable
+        to create the output directory for the generated code. (markt)
+      </add>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <add>


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