? .nbattrs
? compile-to-class.patch
? JspC.class
Index: CommandLineContext.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/share/org/apache/jasper/CommandLineContext.java,v
retrieving revision 1.7
diff -u -w -r1.7 CommandLineContext.java
--- CommandLineContext.java	2001/01/07 19:24:12	1.7
+++ CommandLineContext.java	2001/03/22 19:04:34
@@ -68,6 +68,9 @@
 import org.apache.jasper.compiler.TagLibraries;
 import org.apache.jasper.compiler.CommandLineCompiler;
 import org.apache.jasper.compiler.Compiler;
+import org.apache.jasper.compiler.SunJavaCompiler;
+import org.apache.jasper.compiler.JavaCompiler;
+import org.apache.tomcat.util.log.*;
 
 //import org.apache.jasper.runtime.JspLoader;
 // Use the jasper loader - the only function used is to add a jar
@@ -318,7 +321,30 @@
      * compilers that are created. 
      */
     public Compiler createCompiler() throws JasperException {
-        return new CommandLineCompiler(this);
+	String compilerPath = options.getJspCompilerPath();
+	Class jspCompilerPlugin = options.getJspCompilerPlugin();
+        JavaCompiler javac;
+
+	if (jspCompilerPlugin != null) {
+            try {
+                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
+            } catch (Exception ex) {
+		Constants.message("jsp.warning.compiler.class.cantcreate",
+				  new Object[] { jspCompilerPlugin, ex }, 
+				  Log.FATAL);
+                javac = new SunJavaCompiler();
+	    }
+	} else {
+            javac = new SunJavaCompiler();
+	}
+
+        if (compilerPath != null)
+            javac.setCompilerPath(compilerPath);
+
+        Compiler jspCompiler = new CommandLineCompiler(this);
+	jspCompiler.setJavaCompiler(javac);
+         
+        return jspCompiler;
     }
 
 
Index: JspC.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v
retrieving revision 1.21
diff -u -w -r1.21 JspC.java
--- JspC.java	2001/03/02 04:51:25	1.21
+++ JspC.java	2001/03/22 19:04:34
@@ -69,6 +69,7 @@
 import org.apache.jasper.compiler.TagLibraries;
 import org.apache.jasper.compiler.Compiler;
 import org.apache.jasper.compiler.CommandLineCompiler;
+import org.apache.jasper.compiler.Mangler;
 
 //import org.apache.jasper.runtime.JspLoader;
 import org.apache.jasper.servlet.JasperLoader;
@@ -324,6 +325,11 @@
 
 // 	QueueLogger ql = new QueueLogger();
 // 	ql.setVerbosityLevel(verbosityLevel);
+        LogManager lm = new LogManager();
+        LogHandler lh = new LogHandler();
+        lh.setLevel(verbosityLevel);
+        lm.addChannel("JASPER_LOG", lh);
+        Log.setLogManager(lm);
         Constants.jasperLog = Log.getLog("JASPER_LOG", this );
 //         Constants.jasperLog.setLogger( ql );
 
@@ -372,17 +378,17 @@
                     }
                 }
             }
-            CommandLineCompiler clc = new CommandLineCompiler(clctxt);
+            Compiler compiler = clctxt.createCompiler(); 
+            Mangler mangler = (Mangler) compiler;
+            compiler.compile();
 
-            clc.compile();
-
             targetClassName = null;
             String thisServletName;
-            if  (clc.getPackageName() == null) {
-                thisServletName = clc.getClassName();
+            if  (mangler.getPackageName() == null) {
+                thisServletName = mangler.getClassName();
              } else {
-                thisServletName = clc.getPackageName()
-                    + '.' + clc.getClassName();
+                thisServletName = mangler.getPackageName()
+                    + '.' + mangler.getClassName();
             }
             if (servletout != null) {
                 servletout.write("\n\t<servlet>\n\t\t<servlet-name>");
