Author: remm
Date: Thu Sep  7 08:03:06 2006
New Revision: 441109

URL: http://svn.apache.org/viewvc?view=rev&rev=441109
Log:
- Starting on a Jasper cleanup.
- Make some classes extensible.
- Add some options (like a compiler class name parameter).
- Clean up exception processing.
- Remove fields which are not used.
- Externalize missing strings.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/Constants.java
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/EmbeddedServletOptions.java
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspC.java
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/Options.java
    
tomcat/tc6.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/Constants.java?view=diff&rev=441109&r1=441108&r2=441109
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/Constants.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/Constants.java Thu Sep  7 
08:03:06 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999,2004 The Apache Software Foundation.
+ * Copyright 1999,2004-2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,17 +26,20 @@
  * @author Mark Roth
  */
 public class Constants {
+    
     /**
      * The base class of the generated servlets. 
      */
-    public static final String JSP_SERVLET_BASE = 
"org.apache.jasper.runtime.HttpJspBase";
+    public static final String JSP_SERVLET_BASE = 
+        System.getProperty("org.apache.jasper.Constants.JSP_SERVLET_BASE", 
"org.apache.jasper.runtime.HttpJspBase");
 
     /**
      * _jspService is the name of the method that is called by 
      * HttpJspBase.service(). This is where most of the code generated
      * from JSPs go.
      */
-    public static final String SERVICE_METHOD_NAME = "_jspService";
+    public static final String SERVICE_METHOD_NAME = 
+        System.getProperty("org.apache.jasper.Constants.SERVICE_METHOD_NAME", 
"_jspService");
 
     /**
      * Default servlet content type.
@@ -54,37 +57,27 @@
     };
 
     /**
-     * FIXME
      * ServletContext attribute for classpath. This is tomcat specific. 
      * Other servlet engines may choose to support this attribute if they 
      * want to have this JSP engine running on them. 
      */
-    public static final String SERVLET_CLASSPATH = 
"org.apache.catalina.jsp_classpath";
+    public static final String SERVLET_CLASSPATH = 
+        System.getProperty("org.apache.jasper.Constants.SERVLET_CLASSPATH", 
"org.apache.catalina.jsp_classpath");
 
     /**
-     * FIXME
      * Request attribute for <code>&lt;jsp-file&gt;</code> element of a
      * servlet definition.  If present on a request, this overrides the
      * value returned by <code>request.getServletPath()</code> to select
      * the JSP page to be executed.
      */
-    public static final String JSP_FILE = "org.apache.catalina.jsp_file";
+    public static final String JSP_FILE = 
+        System.getProperty("org.apache.jasper.Constants.JSP_FILE", 
"org.apache.catalina.jsp_file");
 
 
     /**
-     * FIXME
-     * ServletContext attribute for class loader. This is tomcat specific. 
-     * Other servlet engines can choose to have this attribute if they 
-     * want to have this JSP engine running on them. 
-     */
-    //public static final String SERVLET_CLASS_LOADER = 
"org.apache.tomcat.classloader";
-    public static final String SERVLET_CLASS_LOADER = 
"org.apache.catalina.classloader";
-
-    /**
      * Default size of the JSP buffer.
      */
-    public static final int K = 1024;
-    public static final int DEFAULT_BUFFER_SIZE = 8*K;
+    public static final int DEFAULT_BUFFER_SIZE = 8 * 1024;
 
     /**
      * Default size for the tag buffers.
@@ -100,29 +93,31 @@
      * The query parameter that causes the JSP engine to just
      * pregenerated the servlet but not invoke it. 
      */
-    public static final String PRECOMPILE = "jsp_precompile";
+    public static final String PRECOMPILE = 
+        System.getProperty("org.apache.jasper.Constants.PRECOMPILE", 
"jsp_precompile");
 
     /**
      * The default package name for compiled jsp pages.
      */
-    public static final String JSP_PACKAGE_NAME = "org.apache.jsp";
+    public static final String JSP_PACKAGE_NAME = 
+        System.getProperty("org.apache.jasper.Constants.JSP_PACKAGE_NAME", 
"org.apache.jsp");
 
     /**
      * The default package name for tag handlers generated from tag files
      */
-    public static final String TAG_FILE_PACKAGE_NAME = "org.apache.jsp.tag";
+    public static final String TAG_FILE_PACKAGE_NAME = 
+        
System.getProperty("org.apache.jasper.Constants.TAG_FILE_PACKAGE_NAME", 
"org.apache.jsp.tag");
 
     /**
      * Servlet context and request attributes that the JSP engine
      * uses. 
      */
-    public static final String INC_REQUEST_URI = 
"javax.servlet.include.request_uri";
     public static final String INC_SERVLET_PATH = 
"javax.servlet.include.servlet_path";
     public static final String TMP_DIR = "javax.servlet.context.tempdir";
-    public static final String FORWARD_SEEN = "javax.servlet.forward.seen";
 
     // Must be kept in sync with org/apache/catalina/Globals.java
-    public static final String ALT_DD_ATTR = 
"org.apache.catalina.deploy.alt_dd";
+    public static final String ALT_DD_ATTR = 
+        System.getProperty("org.apache.jasper.Constants.ALT_DD_ATTR", 
"org.apache.catalina.deploy.alt_dd");
 
     /**
      * Public Id and the Resource path (of the cached copy) 
@@ -182,13 +177,13 @@
      * Prefix to use for generated temporary variable names
      */
     public static final String TEMP_VARIABLE_NAME_PREFIX =
-        "_jspx_temp";
+        
System.getProperty("org.apache.jasper.Constants.TEMP_VARIABLE_NAME_PREFIX", 
"_jspx_temp");
 
     /**
      * A replacement char for "\$".
      * XXX This is a hack to avoid changing EL interpreter to recognize "\$"
      */
-    public static final char ESC='\u001b';
-    public static final String ESCStr="'\\u001b'";
-}
+    public static final char ESC = '\u001b';
+    public static final String ESCStr = "'\\u001b'";
 
+}

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/jasper/EmbeddedServletOptions.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/EmbeddedServletOptions.java?view=diff&rev=441109&r1=441108&r2=441109
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/EmbeddedServletOptions.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/EmbeddedServletOptions.java Thu 
Sep  7 08:03:06 2006
@@ -144,6 +144,11 @@
     private String compilerSourceVM = "1.5";
     
     /**
+     * The compiler class name.
+     */
+    private String compilerClassName = null;
+    
+    /**
      * Cache for the TLD locations
      */
     private TldLocationsCache tldLocationsCache = null;
@@ -315,6 +320,13 @@
         return compilerSourceVM;
     }
     
+    /**
+     * Java compiler class to use.
+     */
+    public String getCompilerClassName() {
+        return compilerClassName;
+    }
+
     public boolean getErrorOnUseBeanInvalidClassAttribute() {
         return errorOnUseBeanInvalidClassAttribute;
     }
@@ -608,6 +620,11 @@
         String javaEncoding = config.getInitParameter("javaEncoding");
         if (javaEncoding != null) {
             this.javaEncoding = javaEncoding;
+        }
+        
+        String compilerClassName = 
config.getInitParameter("compilerClassName");
+        if (compilerClassName != null) {
+            this.compilerClassName = compilerClassName;
         }
         
         String fork = config.getInitParameter("fork");

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspC.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspC.java?view=diff&rev=441109&r1=441108&r2=441109
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspC.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspC.java Thu Sep  7 08:03:06 
2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999,2004-2005 The Apache Software Foundation.
+ * Copyright 1999,2004-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -94,143 +94,140 @@
             "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
 
     // Logger
-    private static Log log = LogFactory.getLog(JspC.class);
+    protected static Log log = LogFactory.getLog(JspC.class);
 
-    private static final String SWITCH_VERBOSE = "-v";
-    private static final String SWITCH_HELP = "-help";
-    private static final String SWITCH_QUIET = "-q";
-    private static final String SWITCH_OUTPUT_DIR = "-d";
-    private static final String SWITCH_IE_CLASS_ID = "-ieplugin";
-    private static final String SWITCH_PACKAGE_NAME = "-p";
-    private static final String SWITCH_CACHE = "-cache";
-    private static final String SWITCH_CLASS_NAME = "-c";
-    private static final String SWITCH_FULL_STOP = "--";
-    private static final String SWITCH_COMPILE = "-compile";
-    private static final String SWITCH_SOURCE = "-source";
-    private static final String SWITCH_TARGET = "-target";
-    private static final String SWITCH_URI_BASE = "-uribase";
-    private static final String SWITCH_URI_ROOT = "-uriroot";
-    private static final String SWITCH_FILE_WEBAPP = "-webapp";
-    private static final String SWITCH_WEBAPP_INC = "-webinc";
-    private static final String SWITCH_WEBAPP_XML = "-webxml";
-    private static final String SWITCH_MAPPED = "-mapped";
-    private static final String SWITCH_XPOWERED_BY = "-xpoweredBy";
-    private static final String SWITCH_TRIM_SPACES = "-trimSpaces";
-    private static final String SWITCH_CLASSPATH = "-classpath";
-    private static final String SWITCH_DIE = "-die";
-    private static final String SWITCH_POOLING = "-poolingEnabled";
-    private static final String SWITCH_ENCODING = "-javaEncoding";
-    private static final String SWITCH_SMAP = "-smap";
-    private static final String SWITCH_DUMP_SMAP = "-dumpsmap";
-
-    private static final String SHOW_SUCCESS ="-s";
-    private static final String LIST_ERRORS = "-l";
-    private static final int NO_WEBXML = 0;
-    private static final int INC_WEBXML = 10;
-    private static final int ALL_WEBXML = 20;
-    private static final int DEFAULT_DIE_LEVEL = 1;
-    private static final int NO_DIE_LEVEL = 0;
+    protected static final String SWITCH_VERBOSE = "-v";
+    protected static final String SWITCH_HELP = "-help";
+    protected static final String SWITCH_OUTPUT_DIR = "-d";
+    protected static final String SWITCH_PACKAGE_NAME = "-p";
+    protected static final String SWITCH_CACHE = "-cache";
+    protected static final String SWITCH_CLASS_NAME = "-c";
+    protected static final String SWITCH_FULL_STOP = "--";
+    protected static final String SWITCH_COMPILE = "-compile";
+    protected static final String SWITCH_SOURCE = "-source";
+    protected static final String SWITCH_TARGET = "-target";
+    protected static final String SWITCH_URI_BASE = "-uribase";
+    protected static final String SWITCH_URI_ROOT = "-uriroot";
+    protected static final String SWITCH_FILE_WEBAPP = "-webapp";
+    protected static final String SWITCH_WEBAPP_INC = "-webinc";
+    protected static final String SWITCH_WEBAPP_XML = "-webxml";
+    protected static final String SWITCH_MAPPED = "-mapped";
+    protected static final String SWITCH_XPOWERED_BY = "-xpoweredBy";
+    protected static final String SWITCH_TRIM_SPACES = "-trimSpaces";
+    protected static final String SWITCH_CLASSPATH = "-classpath";
+    protected static final String SWITCH_DIE = "-die";
+    protected static final String SWITCH_POOLING = "-poolingEnabled";
+    protected static final String SWITCH_ENCODING = "-javaEncoding";
+    protected static final String SWITCH_SMAP = "-smap";
+    protected static final String SWITCH_DUMP_SMAP = "-dumpsmap";
+
+    protected static final String SHOW_SUCCESS ="-s";
+    protected static final String LIST_ERRORS = "-l";
+    protected static final int INC_WEBXML = 10;
+    protected static final int ALL_WEBXML = 20;
+    protected static final int DEFAULT_DIE_LEVEL = 1;
+    protected static final int NO_DIE_LEVEL = 0;
 
-    private static final String[] insertBefore =
+    protected static final String[] insertBefore =
     { "</web-app>", "<servlet-mapping>", "<session-config>",
       "<mime-mapping>", "<welcome-file-list>", "<error-page>", "<taglib>",
       "<resource-env-ref>", "<resource-ref>", "<security-constraint>",
       "<login-config>", "<security-role>", "<env-entry>", "<ejb-ref>",
       "<ejb-local-ref>" };
 
-    private static int die;
-    private String classPath = null;
-    private URLClassLoader loader = null;
-    private boolean trimSpaces = false;
-    private boolean genStringAsCharArray = false;
-    private boolean xpoweredBy;
-    private boolean mappedFile = false;
-    private boolean poolingEnabled = true;
-    private File scratchDir;
-    private String ieClassId = DEFAULT_IE_CLASS_ID;
-    private String targetPackage;
-    private String targetClassName;
-    private String uriBase;
-    private String uriRoot;
-    private Project project;
-    private int dieLevel;
-    private boolean helpNeeded = false;
-    private boolean compile = false;
-    private boolean smapSuppressed = true;
-    private boolean smapDumped = false;
-    private boolean caching = true;
-    private Map cache = new HashMap();
+    protected static int die;
+    protected String classPath = null;
+    protected URLClassLoader loader = null;
+    protected boolean trimSpaces = false;
+    protected boolean genStringAsCharArray = false;
+    protected boolean xpoweredBy;
+    protected boolean mappedFile = false;
+    protected boolean poolingEnabled = true;
+    protected File scratchDir;
+    protected String ieClassId = DEFAULT_IE_CLASS_ID;
+    protected String targetPackage;
+    protected String targetClassName;
+    protected String uriBase;
+    protected String uriRoot;
+    protected Project project;
+    protected int dieLevel;
+    protected boolean helpNeeded = false;
+    protected boolean compile = false;
+    protected boolean smapSuppressed = true;
+    protected boolean smapDumped = false;
+    protected boolean caching = true;
+    protected Map cache = new HashMap();
 
-    private String compiler = null;
+    protected String compiler = null;
 
-    private String compilerTargetVM = "1.4";
-    private String compilerSourceVM = "1.4";
+    protected String compilerTargetVM = "1.4";
+    protected String compilerSourceVM = "1.4";
 
-    private boolean classDebugInfo = true;
+    protected boolean classDebugInfo = true;
 
     /**
      * Throw an exception if there's a compilation error, or swallow it.
      * Default is true to preserve old behavior.
      */
-    private boolean failOnError = true;
+    protected boolean failOnError = true;
 
     /**
      * The file extensions to be handled as JSP files.
      * Default list is .jsp and .jspx.
      */
-    private List extensions;
+    protected List extensions;
 
     /**
      * The pages.
      */
-    private List pages = new Vector();
+    protected List pages = new Vector();
 
     /**
      * Needs better documentation, this data member does.
      * True by default.
      */
-    private boolean errorOnUseBeanInvalidClassAttribute = true;
+    protected boolean errorOnUseBeanInvalidClassAttribute = true;
 
     /**
      * The java file encoding.  Default
      * is UTF-8.  Added per bugzilla 19622.
      */
-    private String javaEncoding = "UTF-8";
+    protected String javaEncoding = "UTF-8";
 
     // Generation of web.xml fragments
-    private String webxmlFile;
-    private int webxmlLevel;
-    private boolean addWebXmlMappings = false;
-
-    private Writer mapout;
-    private CharArrayWriter servletout;
-    private CharArrayWriter mappingout;
+    protected String webxmlFile;
+    protected int webxmlLevel;
+    protected boolean addWebXmlMappings = false;
+
+    protected Writer mapout;
+    protected CharArrayWriter servletout;
+    protected CharArrayWriter mappingout;
 
     /**
      * The servlet context.
      */
-    private JspCServletContext context;
+    protected JspCServletContext context;
 
     /**
      * The runtime context.
      * Maintain a dummy JspRuntimeContext for compiling tag files.
      */
-    private JspRuntimeContext rctxt;
+    protected JspRuntimeContext rctxt;
 
     /**
      * Cache for the TLD locations
      */
-    private TldLocationsCache tldLocationsCache = null;
+    protected TldLocationsCache tldLocationsCache = null;
 
-    private JspConfig jspConfig = null;
-    private TagPluginManager tagPluginManager = null;
+    protected JspConfig jspConfig = null;
+    protected TagPluginManager tagPluginManager = null;
 
-    private boolean verbose = false;
-    private boolean listErrors = false;
-    private boolean showSuccess = false;
-    private int argPos;
-    private boolean fullstop = false;
-    private String args[];
+    protected boolean verbose = false;
+    protected boolean listErrors = false;
+    protected boolean showSuccess = false;
+    protected int argPos;
+    protected boolean fullstop = false;
+    protected String args[];
 
     public static void main(String arg[]) {
         if (arg.length == 0) {
@@ -246,7 +243,6 @@
                 }
             } catch (JasperException je) {
                 System.err.println(je);
-                //System.err.println(je.getMessage());
                 if (die != NO_DIE_LEVEL) {
                     System.exit(die);
                 }
@@ -566,6 +562,13 @@
     }
 
     /**
+     * Compiler class name to use.
+     */
+    public String getCompilerClassName() {
+        return null;
+    }
+    
+    /**
      * @see Options#getCompilerTargetVM
      */
     public String getCompilerTargetVM() {
@@ -939,7 +942,7 @@
 
     }
 
-    private void processFile(String file)
+    protected void processFile(String file)
         throws JasperException
     {
         ClassLoader originalClassLoader = null;
@@ -1029,8 +1032,8 @@
      * jsps are specified.
      */
     public void scanFiles( File base ) throws JasperException {
-        Stack dirs = new Stack();
-        dirs.push(base);
+        Stack<String> dirs = new Stack<String>();
+        dirs.push(base.toString());
 
         // Make sure default extensions are always included
         if ((getExtensions() == null) || (getExtensions().size() < 2)) {
@@ -1039,7 +1042,7 @@
         }
 
         while (!dirs.isEmpty()) {
-            String s = dirs.pop().toString();
+            String s = dirs.pop();
             File f = new File(s);
             if (f.exists() && f.isDirectory()) {
                 String[] files = f.list();
@@ -1161,9 +1164,9 @@
         }
     }
 
-    // ==================== Private utility methods ====================
+    // ==================== protected utility methods ====================
 
-    private String nextArg() {
+    protected String nextArg() {
         if ((argPos >= args.length)
             || (fullstop = SWITCH_FULL_STOP.equals(args[argPos]))) {
             return null;
@@ -1172,7 +1175,7 @@
         }
     }
 
-    private String nextFile() {
+    protected String nextFile() {
         if (fullstop) argPos++;
         if (argPos >= args.length) {
             return null;
@@ -1181,7 +1184,7 @@
         }
     }
 
-    private void initWebXml() {
+    protected void initWebXml() {
         try {
             if (webxmlLevel >= INC_WEBXML) {
                 File fmapings = new File(webxmlFile);
@@ -1207,7 +1210,7 @@
         }
     }
 
-    private void completeWebXml() {
+    protected void completeWebXml() {
         if (mapout != null) {
             try {
                 servletout.writeTo(mapout);
@@ -1224,7 +1227,7 @@
         }
     }
 
-    private void initServletContext() {
+    protected void initServletContext() {
         try {
             context =new JspCServletContext
                 (new PrintWriter(System.out),
@@ -1245,7 +1248,7 @@
      * @param clctxt The compilation context
      * @throws IOException If an error occurs
      */
-    private void initClassLoader(JspCompilationContext clctxt)
+    protected void initClassLoader(JspCompilationContext clctxt)
         throws IOException {
 
         classPath = getClassPath();
@@ -1257,7 +1260,7 @@
         }
 
         // Turn the classPath into URLs
-        ArrayList urls = new ArrayList();
+        ArrayList<URL> urls = new ArrayList<URL>();
         StringTokenizer tokenizer = new StringTokenizer(classPath,
                                                         File.pathSeparator);
         while (tokenizer.hasMoreTokens()) {
@@ -1330,7 +1333,7 @@
      * This is used if no explicit docbase is set, but only files.
      * XXX Maybe we should require the docbase.
      */
-    private void locateUriRoot( File f ) {
+    protected void locateUriRoot( File f ) {
         String tUriBase = uriBase;
         if (tUriBase == null) {
             tUriBase = "/";

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java?view=diff&rev=441109&r1=441108&r2=441109
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java Thu 
Sep  7 08:03:06 2006
@@ -208,15 +208,19 @@
             return jspCompiler;
         }
         jspCompiler = null;
-        if (options.getCompiler() == null) {
-            jspCompiler = 
createCompiler("org.apache.jasper.compiler.JDTCompiler");
-            if (jspCompiler == null) {
-                jspCompiler = 
createCompiler("org.apache.jasper.compiler.AntCompiler");
-            }
+        if (options.getCompilerClassName() != null) {
+            jspCompiler = createCompiler(options.getCompilerClassName());
         } else {
-            jspCompiler = 
createCompiler("org.apache.jasper.compiler.AntCompiler");
-            if (jspCompiler == null) {
+            if (options.getCompiler() == null) {
                 jspCompiler = 
createCompiler("org.apache.jasper.compiler.JDTCompiler");
+                if (jspCompiler == null) {
+                    jspCompiler = 
createCompiler("org.apache.jasper.compiler.AntCompiler");
+                }
+            } else {
+                jspCompiler = 
createCompiler("org.apache.jasper.compiler.AntCompiler");
+                if (jspCompiler == null) {
+                    jspCompiler = 
createCompiler("org.apache.jasper.compiler.JDTCompiler");
+                }
             }
         }
         if (jspCompiler == null) {
@@ -230,9 +234,13 @@
         Compiler compiler = null; 
         try {
             compiler = (Compiler) Class.forName(className).newInstance();
-        } catch (Throwable t) {
+        } catch (InstantiationException e) {
+            log.warn(Localizer.getMessage("jsp.error.compiler"), e);
+        } catch (IllegalAccessException e) {
+            log.warn(Localizer.getMessage("jsp.error.compiler"), e);
+        } catch (ClassNotFoundException e) {
             if (log.isDebugEnabled()) {
-                log.debug(Localizer.getMessage("jsp.error.compiler"), t);
+                log.debug(Localizer.getMessage("jsp.error.compiler"), e);
             }
         }
         return compiler;
@@ -428,21 +436,12 @@
      * generated. 
      */
     public String getServletJavaFileName() {
-
         if (servletJavaFileName == null) {
-            servletJavaFileName =
-               getOutputDir() + getServletClassName() + ".java";
-        } else {
-            // Make sure output dir exists
-            makeOutputDir();
+            servletJavaFileName = getOutputDir() + getServletClassName() + 
".java";
         }
         return servletJavaFileName;
     }
 
-    public void setServletJavaFileName(String servletJavaFileName) {
-        this.servletJavaFileName = servletJavaFileName;
-    }
-
     /**
      * Get hold of the Options object for this context. 
      */
@@ -478,12 +477,8 @@
     }
 
     public String getClassFileName() {
-
         if (classFileName == null) {
             classFileName = getOutputDir() + getServletClassName() + ".class";
-        } else {
-            // Make sure output dir exists
-            makeOutputDir();
         }
         return classFileName;
     }
@@ -606,10 +601,10 @@
 
     static Object outputDirLock = new Object();
 
-    private void makeOutputDir() {
+    private boolean makeOutputDir() {
         synchronized(outputDirLock) {
             File outDirFile = new File(outputDir);
-            outDirFile.mkdirs();
+            return outDirFile.mkdirs();
         }
     }
 
@@ -623,17 +618,18 @@
             path = getServletPackageName().replace('.', '/');
        }
 
-        try {
             // Append servlet or tag handler path to scratch dir
-            baseUrl = options.getScratchDir().toURL();
-            String outUrlString = baseUrl.toString() + '/' + path;
-            URL outUrl = new URL(outUrlString);
-            outputDir = outUrl.getFile() + File.separator;
-            makeOutputDir();
-        } catch (Exception e) {
-            throw new IllegalStateException("No output directory: " +
-                                            e.getMessage());
-        }
+            try {
+                baseUrl = options.getScratchDir().toURL();
+                String outUrlString = baseUrl.toString() + '/' + path;
+                URL outUrl = new URL(outUrlString);
+                outputDir = outUrl.getFile() + File.separator;
+                if (!makeOutputDir()) {
+                    throw new 
IllegalStateException(Localizer.getMessage("jsp.error.outputfolder"));
+                }
+            } catch (MalformedURLException e) {
+                throw new 
IllegalStateException(Localizer.getMessage("jsp.error.outputfolder"), e);
+            }
     }
     
     private static final boolean isPathSeparator(char c) {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/Options.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/Options.java?view=diff&rev=441109&r1=441108&r2=441109
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/Options.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/Options.java Thu Sep  7 
08:03:06 2006
@@ -123,6 +123,11 @@
     public String getCompilerSourceVM();   
 
     /**
+     * Java compiler class to use.
+     */
+    public String getCompilerClassName();   
+
+    /**
      * The cache for the location of the TLD's
      * for the various tag libraries 'exposed'
      * by the web application.

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties?view=diff&rev=441109&r1=441108&r2=441109
==============================================================================
--- 
tomcat/tc6.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties 
(original)
+++ 
tomcat/tc6.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties 
Thu Sep  7 08:03:06 2006
@@ -34,6 +34,7 @@
 jsp.error.usebean.bad.type.cast=useBean ({0}): Type ({1}) is not assignable 
from class ({2}) 
 jsp.error.invalid.scope=Illegal value of \'scope\' attribute: {0} (must be one 
of \"page\", \"request\", \"session\", or \"application\")
 jsp.error.classname=Can't determine classname from .class file
+jsp.error.outputfolder=No output folder
 jsp.warning.bad.type=Warning: bad type in .class file
 jsp.error.data.file.write=Error while writing data file
 jsp.error.page.invalid.buffer=Page directive: invalid buffer size

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?view=diff&rev=441109&r1=441108&r2=441109
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java 
Thu Sep  7 08:03:06 2006
@@ -711,9 +711,6 @@
                String includeUri = (String) request
                                .getAttribute(Constants.INC_SERVLET_PATH);
 
-               final ServletResponse fresponse = response;
-               final ServletRequest frequest = request;
-
                if (includeUri != null)
                        request.removeAttribute(Constants.INC_SERVLET_PATH);
                try {
@@ -721,7 +718,6 @@
                } finally {
                        if (includeUri != null)
                                
request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
-                       request.setAttribute(Constants.FORWARD_SEEN, "true");
                }
        }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to