tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime JspLoader.java JspServlet.java
Date Sun, 13 Feb 2000 06:25:25 GMT
akv         00/02/12 22:25:25

  Modified:    src/share/org/apache/jasper Constants.java
                        EmbededServletOptions.java JspC.java
                        JspEngineContext.java Options.java
               src/share/org/apache/jasper/compiler Compiler.java
                        JspParseEventListener.java Parser.java
                        TagLibraryInfoImpl.java
               src/share/org/apache/jasper/runtime JspLoader.java
                        JspServlet.java
  Log:
  Changed Jasper to use the new logging framework.
  
  **** TODO ***** Make sure jspc works after these changes.
  
  Revision  Changes    Path
  1.10      +10 -21    jakarta-tomcat/src/share/org/apache/jasper/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Constants.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Constants.java	1999/11/13 00:32:44	1.9
  +++ Constants.java	2000/02/13 06:25:23	1.10
  @@ -60,6 +60,8 @@
   import java.util.MissingResourceException;
   import java.text.MessageFormat;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * Some constants and other global data that are used by the compiler and the runtime.
    *
  @@ -116,17 +118,6 @@
   
   
       /**
  -     * Codes that indicate how verbose you want the JSP engine to be. 
  -     */
  -    public static final int FATAL_ERRORS = Integer.MIN_VALUE;
  -    public static final int WARNING = 0;
  -    public static final int LOW_VERBOSITY = 1;
  -    public static final int MED_VERBOSITY = 2;
  -    public static final int HIGH_VERBOSITY = 3;
  -
  -    public static int jspVerbosityLevel = 0;
  -
  -    /**
        * Default size of the JSP buffer.
        */
       public static final int K = 1024;
  @@ -216,14 +207,6 @@
           }
       }
   
  -    /**
  -     * Tells you if the current verbosity level allow output of
  -     * messages with a certain verbosity level. 
  -     */
  -    public static final boolean matchVerbosity(int verbosityLevel) {
  -        return verbosityLevel <= jspVerbosityLevel;
  -    }
  -
       /** 
        * Print a message into standard error with a certain verbosity
        * level. 
  @@ -238,6 +221,7 @@
           message(key, null, verbosityLevel);
       }
   
  +
       /**
        * Print a message into standard error with a certain verbosity
        * level after formatting it using "args". 
  @@ -249,8 +233,13 @@
        *                       level. 
        */
       public static final void message(String key, Object[] args, int verbosityLevel) {
  -        if (matchVerbosity(verbosityLevel))
  -            System.err.println(getString(key, args));
  +	if (jasperLog == null)
  +	    jasperLog = Logger.getLogger("JASPER_LOG");
  +
  +	if (jasperLog != null)
  +	    jasperLog.log(getString(key, args), verbosityLevel);
       }
  +
  +    public static Logger jasperLog = null;
   }
   
  
  
  
  1.2       +12 -33    jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java
  
  Index: EmbededServletOptions.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EmbededServletOptions.java	2000/01/24 05:54:50	1.1
  +++ EmbededServletOptions.java	2000/02/13 06:25:23	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java,v
1.1 2000/01/24 05:54:50 shemnon Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/01/24 05:54:50 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java,v
1.2 2000/02/13 06:25:23 akv Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/02/13 06:25:23 $
    *
    * ====================================================================
    * 
  @@ -66,6 +66,8 @@
   import javax.servlet.ServletConfig;
   import javax.servlet.ServletContext;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * A class to hold all init parameters specific to the JSP engine. 
    *
  @@ -94,12 +96,6 @@
       public boolean sendErrorToClient = false;
   
       /**
  -     * Current verbosity level. FIXME: This stuff is duplicated: see
  -     * Constants.jspVerbosityLevel. 
  -     */
  -    public int jspVerbosityLevel = Constants.MED_VERBOSITY;
  -
  -    /**
        * I want to see my generated servlets. Which directory are they
        * in?
        */
  @@ -157,13 +153,6 @@
       }
       
       /**
  -     * What is the current verbosity level?
  -     */
  -    public int getJspVerbosityLevel() {
  -        return jspVerbosityLevel;
  -    }
  -
  -    /**
        * What is my scratch dir?
        */
       public File getScratchDir() {
  @@ -204,7 +193,7 @@
                   this.keepGenerated = true;
               else if (keepgen.equalsIgnoreCase("false"))
                   this.keepGenerated = false;
  -            else Constants.message ("jsp.warning.keepgen", Constants.FATAL_ERRORS);
  +            else Constants.message ("jsp.warning.keepgen", Logger.WARNING);
           }
               
   
  @@ -214,7 +203,7 @@
                   this.largeFile = true;
               else if (largeFile.equalsIgnoreCase("false"))
                   this.largeFile = false;
  -            else Constants.message ("jsp.warning.largeFile", Constants.FATAL_ERRORS);
  +            else Constants.message ("jsp.warning.largeFile", Logger.WARNING);
           }
   
           String senderr = config.getInitParameter("sendErrToClient");
  @@ -223,7 +212,7 @@
                   this.sendErrorToClient = true;
               else if (senderr.equalsIgnoreCase("false"))
                   this.sendErrorToClient = false;
  -            else Constants.message ("jsp.warning.sendErrToClient", Constants.FATAL_ERRORS);
  +            else Constants.message ("jsp.warning.sendErrToClient", Logger.WARNING);
           }
   
           String ieClassId = config.getInitParameter("ieClassId");
  @@ -234,16 +223,6 @@
           if (classpath != null)
               this.classpath = classpath;
   
  -        String verbosityLevel = config.getInitParameter("jspVerbosityLevel");
  -            
  -        if (verbosityLevel != null)
  -            try {
  -                int vl = Integer.parseInt(verbosityLevel);
  -                jspVerbosityLevel = vl;
  -                Constants.jspVerbosityLevel = jspVerbosityLevel;
  -            } catch (NumberFormatException nex) {
  -            }
  -
           String dir = config.getInitParameter("scratchdir"); 
   
           if (dir != null)
  @@ -261,7 +240,7 @@
           }
                   
           if (this.scratchDir == null) {
  -            Constants.message("jsp.error.no.scratch.dir", Constants.FATAL_ERRORS);
  +            Constants.message("jsp.error.no.scratch.dir", Logger.FATAL);
               return;
           }
               
  @@ -270,7 +249,7 @@
               Constants.message("jsp.error.bad.scratch.dir",
                                 new Object[] {
                                     scratchDir.getAbsolutePath()
  -                              }, Constants.FATAL_ERRORS);
  +                              }, Logger.FATAL);
                                     
           String jspCompilerPath = config.getInitParameter("jspCompilerPath");
           if (jspCompilerPath != null) {
  @@ -279,7 +258,7 @@
               } else { 
                   Constants.message("jsp.warning.compiler.path.notfound",
                                     new Object[] { jspCompilerPath }, 
  -                                  Constants.FATAL_ERRORS);
  +                                  Logger.FATAL);
               }
           }
   
  @@ -290,7 +269,7 @@
               } catch (ClassNotFoundException cnfe) {
                   Constants.message("jsp.warning.compiler.class.notfound",
                                     new Object[] { jspCompilerPlugin },
  -                                  Constants.FATAL_ERRORS);
  +                                  Logger.FATAL);
               }
           }
     
  
  
  
  1.3       +20 -10    jakarta-tomcat/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JspC.java	2000/02/09 06:50:47	1.2
  +++ JspC.java	2000/02/13 06:25:23	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.2 2000/02/09
06:50:47 shemnon Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/02/09 06:50:47 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.3 2000/02/13
06:25:23 akv Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/02/13 06:25:23 $
    *
    * ====================================================================
    * 
  @@ -70,11 +70,15 @@
   
   import org.apache.jasper.runtime.JspLoader;
   
  +import org.apache.tomcat.logging.Logger;
  +import org.apache.tomcat.logging.TomcatLogger;
  +
   /**
    * Shell for the jspc compiler.  Handles all options associated with the 
    * command line and creates compilation contexts which it then compiles
    * according to the specified options.
  - *@author Danno Ferrin
  + *
  + * @author Danno Ferrin
    */
   public class JspC implements Options { //, JspCompilationContext {
   
  @@ -98,7 +102,7 @@
       
       boolean largeFile = false;
   
  -    int jspVerbosityLevel = Constants.MED_VERBOSITY;
  +    int jspVerbosityLevel = Logger.INFORMATION;
   
       File scratchDir;
   
  @@ -195,15 +199,17 @@
           args = arg;
           String tok;
   
  +	int verbosityLevel = Logger.WARNING;
  +	
           while ((tok = nextArg()) != null) {
               if (tok.equals(SWITCH_QUIET)) {
  -                Constants.jspVerbosityLevel = Constants.WARNING;
  +		verbosityLevel = Logger.WARNING;
               } else if (tok.equals(SWITCH_VERBOSE)) {
  -                Constants.jspVerbosityLevel = Constants.HIGH_VERBOSITY;
  +                verbosityLevel = Logger.INFORMATION;
               } else if (tok.startsWith(SWITCH_VERBOSE)) {
                   try {
  -                    Constants.jspVerbosityLevel = Integer.parseInt(
  -                            tok.substring(SWITCH_VERBOSE.length()));
  +                    verbosityLevel 
  +			= Integer.parseInt(tok.substring(SWITCH_VERBOSE.length()));
                   } catch (NumberFormatException nfe) {
                       log.println(
                           "Verbosity level " 
  @@ -247,6 +253,10 @@
                   break;
               }
           }
  +
  +	Constants.jasperLog = new TomcatLogger();
  +	Constants.jasperLog.setVerbosityLevel(verbosityLevel);
  +
       };
       
       public void parseFiles(PrintStream log)  throws JasperException {
  @@ -271,7 +281,7 @@
                               uriRoot = f.getCanonicalPath();
                               Constants.message("jspc.implicit.uriRoot",
                                                 new Object[] { uriRoot },
  -                                              Constants.MED_VERBOSITY);
  +                                              Logger.INFORMATION);
                               break;
                           }
                           f = new File(f.getParent());
  
  
  
  1.6       +6 -4      jakarta-tomcat/src/share/org/apache/jasper/JspEngineContext.java
  
  Index: JspEngineContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspEngineContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JspEngineContext.java	2000/01/24 05:54:50	1.5
  +++ JspEngineContext.java	2000/02/13 06:25:23	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspEngineContext.java,v
1.5 2000/01/24 05:54:50 shemnon Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/01/24 05:54:50 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspEngineContext.java,v
1.6 2000/02/13 06:25:23 akv Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/02/13 06:25:23 $
    *
    * ====================================================================
    * 
  @@ -79,6 +79,8 @@
   import org.apache.jasper.compiler.SunJavaCompiler;
   import org.apache.jasper.compiler.JavaCompiler;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * A place holder for various things that are used through out the JSP
    * engine. This is a per-request/per-context data structure. Some of
  @@ -297,7 +299,7 @@
               } catch (Exception ex) {
   		Constants.message("jsp.warning.compiler.class.cantcreate",
   				  new Object[] { jspCompilerPlugin, ex }, 
  -				  Constants.FATAL_ERRORS);
  +				  Logger.FATAL);
                   javac = new SunJavaCompiler();
   	    }
   	} else {
  
  
  
  1.9       +4 -11     jakarta-tomcat/src/share/org/apache/jasper/Options.java
  
  Index: Options.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Options.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Options.java	2000/01/24 05:54:50	1.8
  +++ Options.java	2000/02/13 06:25:23	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Options.java,v 1.8 2000/01/24
05:54:50 shemnon Exp $
  - * $Revision: 1.8 $
  - * $Date: 2000/01/24 05:54:50 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Options.java,v 1.9 2000/02/13
06:25:23 akv Exp $
  + * $Revision: 1.9 $
  + * $Date: 2000/02/13 06:25:23 $
    *
    * ====================================================================
    * 
  @@ -73,7 +73,6 @@
    * @author Hans Bergsten
    */
   public interface Options {
  -
       /**
        * Are we keeping generated code around?
        */
  @@ -95,11 +94,6 @@
       public String getIeClassId();
       
       /**
  -     * What is the current verbosity level?
  -     */
  -    public int getJspVerbosityLevel();
  -
  -    /**
        * What is my scratch dir?
        */
       public File getScratchDir();
  @@ -120,6 +114,5 @@
        * Path of the compiler to use for compiling JSP pages.
        */
       public String getJspCompilerPath();
  -
  +    
   }
  -
  
  
  
  1.12      +10 -8     jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Compiler.java	2000/02/09 06:50:49	1.11
  +++ Compiler.java	2000/02/13 06:25:24	1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
1.11 2000/02/09 06:50:49 shemnon Exp $
  - * $Revision: 1.11 $
  - * $Date: 2000/02/09 06:50:49 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v
1.12 2000/02/13 06:25:24 akv Exp $
  + * $Revision: 1.12 $
  + * $Date: 2000/02/13 06:25:24 $
    *
    * ====================================================================
    * 
  @@ -72,6 +72,8 @@
   import org.apache.jasper.JasperException;
   import org.apache.jasper.compiler.ParseException;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * If you want to customize JSP compilation aspects, this class is
    * something you should take a look at. 
  @@ -113,16 +115,16 @@
           Constants.message("jsp.message.package_name_is",
                             new Object[] { (pkgName==null)?
                                             "[default package]":pkgName },
  -                          Constants.MED_VERBOSITY);
  +                          Logger.DEBUG);
           Constants.message("jsp.message.class_name_is",
                             new Object[] { className },
  -                          Constants.MED_VERBOSITY);
  +                          Logger.DEBUG);
           Constants.message("jsp.message.java_file_name_is",
                             new Object[] { javaFileName },
  -                          Constants.MED_VERBOSITY);
  +                          Logger.DEBUG);
           Constants.message("jsp.message.class_file_name_is",
                             new Object[] { classFileName },
  -                          Constants.MED_VERBOSITY);
  +                          Logger.DEBUG);
   
           if (!isOutDated())
               return false;
  @@ -200,7 +202,7 @@
   
           Constants.message("jsp.message.compiling_with",
                             new Object[] { b.toString() },
  -                          Constants.MED_VERBOSITY);
  +                          Logger.DEBUG);
   
           /**
            * 256 chosen randomly. The default is 32 if you don't pass
  
  
  
  1.7       +8 -6      jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java
  
  Index: JspParseEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JspParseEventListener.java	2000/01/24 05:54:51	1.6
  +++ JspParseEventListener.java	2000/02/13 06:25:24	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.6 2000/01/24 05:54:51 shemnon Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/01/24 05:54:51 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.7 2000/02/13 06:25:24 akv Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/02/13 06:25:24 $
    *
    * ====================================================================
    * 
  @@ -80,6 +80,8 @@
   import org.apache.jasper.Constants;
   import org.apache.jasper.JspCompilationContext;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * JSP code generator "backend". 
    *
  @@ -336,7 +338,7 @@
       public void handleComment(Mark start, Mark stop) throws JasperException {
           Constants.message("jsp.message.htmlcomment", 
                             new Object[] { reader.getChars(start, stop) },
  -                          Constants.HIGH_VERBOSITY);
  +                          Logger.DEBUG);
       }
   
       interface PageDirectiveHandler {
  @@ -616,7 +618,7 @@
       {
           Constants.message("jsp.message.handling_directive",
                             new Object[] { directive, attrs },
  -                          Constants.HIGH_VERBOSITY);
  +                          Logger.DEBUG);
   
   	if (directive.equals("page")) {
   	    Enumeration e = attrs.keys();
  @@ -801,7 +803,7 @@
       {
           Constants.message("jsp.message.handling_plugin",
                             new Object[] { attrs },
  -                          Constants.HIGH_VERBOSITY);
  +                          Logger.DEBUG);
   
   	Generator gen = new GeneratorWrapper (new PluginGenerator (attrs,
   					      param, fallback), start, stop);
  
  
  
  1.14      +3 -1      jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Parser.java	2000/02/11 06:45:35	1.13
  +++ Parser.java	2000/02/13 06:25:24	1.14
  @@ -65,6 +65,8 @@
   import javax.servlet.jsp.tagext.TagLibraryInfo;
   import javax.servlet.jsp.tagext.TagInfo;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * The class that parses the JSP input and calls the right methods on
    * the code generator backend. 
  @@ -1029,7 +1031,7 @@
   		if (c.accept(listener, reader, this)) {
                       Constants.message("jsp.message.accepted",
                                         new Object[] { c.getClass().getName(), m },
  -                                      Constants.HIGH_VERBOSITY);
  +                                      Logger.DEBUG);
   		    accepted = true;
   		    break;
   		} 
  
  
  
  1.11      +13 -11    jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
  
  Index: TagLibraryInfoImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TagLibraryInfoImpl.java	2000/01/24 05:54:51	1.10
  +++ TagLibraryInfoImpl.java	2000/02/13 06:25:24	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
1.10 2000/01/24 05:54:51 shemnon Exp $
  - * $Revision: 1.10 $
  - * $Date: 2000/01/24 05:54:51 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
1.11 2000/02/13 06:25:24 akv Exp $
  + * $Revision: 1.11 $
  + * $Date: 2000/02/13 06:25:24 $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -89,6 +89,8 @@
   import org.apache.jasper.Constants;
   import org.apache.jasper.runtime.JspLoader;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * Implementation of the TagLibraryInfo class from the JSP spec. 
    *
  @@ -204,7 +206,7 @@
   	    if (in == null)
   		throw new JasperException(Constants.getString("jsp.error.tld_not_found",
   							      new Object[] {TLD}));
  -	    //Now parse the tld.
  +	    // Now parse the tld.
   	    parseTLD(in);
   	}
   	    
  @@ -239,7 +241,7 @@
   	    
   		Constants.message("jsp.message.copyinguri", 
   	                          new Object[] { uri, jarFileName },
  -				  Constants.MED_VERBOSITY);
  +				  Logger.DEBUG);
   	    
   		if (relativeURL)
   		    copy(ctxt.getResourceAsStream(uri),
  @@ -349,7 +351,7 @@
                                     new Object[] {
                                         e.getTagName()
                                     },
  -                                  Constants.WARNING
  +                                  Logger.WARNING
                                     );
           }
   
  @@ -394,7 +396,7 @@
                                     new Object[] {
                                         e.getTagName()
                                     },
  -                                  Constants.WARNING
  +                                  Logger.WARNING
                                     );
           }
   	TagAttributeInfo[] tagAttributeInfo 
  @@ -412,21 +414,21 @@
                                     new Object[] {
                                         teiclass, cex.getMessage()
                                     },
  -                                  Constants.WARNING
  +                                  Logger.WARNING
                                     );
               } catch (IllegalAccessException iae) {
                   Constants.message("jsp.warning.teiclass.is.null",
                                     new Object[] {
                                         teiclass, iae.getMessage()
                                     },
  -                                  Constants.WARNING
  +                                  Logger.WARNING
                                     );
               } catch (InstantiationException ie) {
                   Constants.message("jsp.warning.teiclass.is.null",
                                     new Object[] {
                                         teiclass, ie.getMessage()
                                     },
  -                                  Constants.WARNING
  +                                  Logger.WARNING
                                     );
               }
           
  @@ -467,7 +469,7 @@
                                     new Object[] {
                                         e.getTagName()
                                     },
  -                                  Constants.WARNING
  +                                  Logger.WARNING
                                     );
           }
           
  
  
  
  1.6       +6 -4      jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java
  
  Index: JspLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JspLoader.java	2000/02/07 07:51:21	1.5
  +++ JspLoader.java	2000/02/13 06:25:25	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java,v
1.5 2000/02/07 07:51:21 shemnon Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/02/07 07:51:21 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java,v
1.6 2000/02/13 06:25:25 akv Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/02/13 06:25:25 $
    *
    * ====================================================================
    * 
  @@ -80,6 +80,8 @@
   import org.apache.jasper.Options;
   import org.apache.jasper.compiler.Compiler;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * This is a class loader that loads JSP files as though they were
    * Java classes. It calls the compiler to compile the JSP file into a
  @@ -255,7 +257,7 @@
           if (!jars.contains(jarFileName)) {
               Constants.message("jsp.message.adding_jar",
                                 new Object[] { jarFileName },
  -                              Constants.MED_VERBOSITY);
  +                              Logger.INFORMATION);
               
               jars.addElement(jarFileName);
           }
  
  
  
  1.16      +45 -47    jakarta-tomcat/src/share/org/apache/jasper/runtime/JspServlet.java
  
  Index: JspServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspServlet.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- JspServlet.java	2000/02/07 07:51:22	1.15
  +++ JspServlet.java	2000/02/13 06:25:25	1.16
  @@ -82,6 +82,8 @@
   
   import org.apache.jasper.compiler.Compiler;
   
  +import org.apache.tomcat.logging.Logger;
  +
   /**
    * The JSP engine (a.k.a Jasper)! 
    *
  @@ -138,7 +140,7 @@
               
               Constants.message("jsp.message.cp_is", 
                                 new Object[] { accordingto, cp }, 
  -                              Constants.MED_VERBOSITY);
  +                              Logger.INFORMATION);
   
   	    //if (loader.loadJSP(jspUri, cp, isErrorPage, req, res) || theServlet == null) {
               if (loadJSP(jspUri, cp, isErrorPage, req, res) 
  @@ -206,44 +208,37 @@
   	this.config = config;
   	this.context = config.getServletContext();
           this.serverInfo = context.getServerInfo();
  -        this.engine = ServletEngine.getServletEngine(serverInfo);
           
  -        if (engine == null)
  -            Constants.message("jsp.error.bad-servlet-engine", Constants.FATAL_ERRORS);
  -        else {
  -            options = new EmbededServletOptions(config, context);
  -
  -            parentClassLoader = (ClassLoader) context.getAttribute(Constants.SERVLET_CLASS_LOADER);
  -            if (parentClassLoader == null)
  -                parentClassLoader = this.getClass().getClassLoader();
  +	options = new EmbededServletOptions(config, context);
  +
  +	parentClassLoader = (ClassLoader) context.getAttribute(Constants.SERVLET_CLASS_LOADER);
  +	if (parentClassLoader == null)
  +	    parentClassLoader = this.getClass().getClassLoader();
               
  -            // getClass().getClassLoader() returns null in JDK 1.1.6/1.1.8
  -            if (parentClassLoader != null) {
  +	// getClass().getClassLoader() returns null in JDK 1.1.6/1.1.8
  +	if (parentClassLoader != null) {
               Constants.message("jsp.message.parent_class_loader_is", 
                                 new Object[] {
                                     parentClassLoader.toString()
  -                              }, Constants.MED_VERBOSITY);
  +                              }, Logger.DEBUG);
               }
  -            else {
  +	else {
               Constants.message("jsp.message.parent_class_loader_is", 
                                 new Object[] {
                                     "<none>"
  -                              }, Constants.MED_VERBOSITY);
  -            }
  -            this.loader = new JspLoader(parentClassLoader, 
  -                                        options);
  -
  -            if (firstTime) {
  -                firstTime = false;
  -                Constants.message("jsp.message.scratch.dir.is", 
  -                                  new Object[] { 
  -                                      options.getScratchDir().toString() 
  -                                  }, Constants.LOW_VERBOSITY );
  -                Constants.message("jsp.message.dont.modify.servlets", Constants.LOW_VERBOSITY);
  -            }
  -            
  -        }
  +                              }, Logger.DEBUG);
  +	}
  +	this.loader = new JspLoader(parentClassLoader, 
  +				    options);
   
  +	if (firstTime) {
  +	    firstTime = false;
  +	    Constants.message("jsp.message.scratch.dir.is", 
  +			      new Object[] { 
  +				  options.getScratchDir().toString() 
  +			      }, Logger.INFORMATION );
  +	    Constants.message("jsp.message.dont.modify.servlets", Logger.INFORMATION);
  +	}
           JspFactory.setDefaultFactory(new JspFactoryImpl());
       }
   
  @@ -350,23 +345,25 @@
   
               boolean precompile = preCompile(request);
   
  -            if (Constants.matchVerbosity(Constants.MED_VERBOSITY)) {
  -		System.err.println("JspEngine --> "+jspUri);
  -                System.err.println("\t     ServletPath: "+request.getServletPath());
  -                System.err.println("\t        PathInfo: "+request.getPathInfo());
  -		System.err.println("\t        RealPath: "
  -                                   +getServletConfig().getServletContext().getRealPath(jspUri));
  -                System.err.println("\t      RequestURI: "+request.getRequestURI());
  -                System.err.println("\t     QueryString: "+request.getQueryString());
  -                System.err.println("\t  Request Params: ");
  -                Enumeration e = request.getParameterNames();
  -                while (e.hasMoreElements()) {
  -                    String name = (String) e.nextElement();
  -                    System.err.println("\t\t "+name+" = "+request.getParameter(name));
  -                }
  -            }
  -            serviceJspFile(request, response, jspUri, null, precompile);
  +	    Logger jasperLog = Constants.jasperLog;
   	    
  +            if (jasperLog != null && jasperLog.matchVerbosityLevel(Logger.INFORMATION))
  +		{
  +		    jasperLog.log("JspEngine --> "+jspUri);
  +		    jasperLog.log("\t     ServletPath: "+request.getServletPath());
  +		    jasperLog.log("\t        PathInfo: "+request.getPathInfo());
  +		    jasperLog.log("\t        RealPath: "
  +				  +getServletConfig().getServletContext().getRealPath(jspUri));
  +		    jasperLog.log("\t      RequestURI: "+request.getRequestURI());
  +		    jasperLog.log("\t     QueryString: "+request.getQueryString());
  +		    jasperLog.log("\t  Request Params: ");
  +		    Enumeration e = request.getParameterNames();
  +		    while (e.hasMoreElements()) {
  +			String name = (String) e.nextElement();
  +			jasperLog.log("\t\t "+name+" = "+request.getParameter(name));
  +		    }
  +		}
  +            serviceJspFile(request, response, jspUri, null, precompile);
   	} catch (RuntimeException e) {
   	    throw e;
   	} catch (ServletException e) {
  @@ -379,8 +376,9 @@
       }
   
       public void destroy() {
  -	if (Constants.matchVerbosity(2))
  -	    System.err.println("JspServlet.destroy()");
  +	if (Constants.jasperLog != null)
  +	    Constants.jasperLog.log("JspServlet.destroy()", Logger.INFORMATION);
  +
   	Enumeration servlets = jsps.elements();
   	while (servlets.hasMoreElements()) 
   	    ((JspServletWrapper) servlets.nextElement()).destroy();
  
  
  

Mime
View raw message