tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shem...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime JspLoader.java JspServlet.java
Date Mon, 24 Jan 2000 05:54:53 GMT
shemnon     00/01/23 21:54:53

  Modified:    src/share/org/apache/jasper JspEngineContext.java
                        Options.java
               src/share/org/apache/jasper/compiler Compiler.java
                        Generator.java GeneratorBase.java JspCompiler.java
                        JspParseEventListener.java JspReader.java
                        PluginGenerator.java TagBeginGenerator.java
                        TagLibraryInfoImpl.java
               src/share/org/apache/jasper/runtime JspLoader.java
                        JspServlet.java
  Added:       src/share/org/apache/jasper EmbededServletOptions.java
                        JspCompilationContext.java
  Log:
  Refactoring to remove the dependencies from the jasper JSP page compiler to
  being run inside of an actual servlet.  This is being done in prepreation
  for a command line JSP to servlet compiler.
  
  * Options was made an interface, with EmbededServletOptions the initial
    implementation.  Method anmes were also beanified.
  * A new interface JspCompilationContext was created, replaceing
    JspEngineContext.  JspEngineContext is an implementation of
    JspCompilationContext.  No classes from javax.servlet are now returned
    and some methods were added to compensate for that absense.
  * Some changes had a great deal of cascading changes, those files were
    changed to match the new APIs.
  
  No tomcat regression tests failed, and no JSP watchdog tests failed, but
  three servlet tests failed, and they failed in the same fashion before
  this change was intoduces.
  
  Revision  Changes    Path
  1.5       +52 -6     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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JspEngineContext.java	2000/01/21 04:17:21	1.4
  +++ JspEngineContext.java	2000/01/24 05:54:50	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspEngineContext.java,v 1.4 2000/01/21 04:17:21 rubys Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/01/21 04:17:21 $
  + * $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 $
    *
    * ====================================================================
    * 
  @@ -90,7 +90,7 @@
    * @author Anil K. Vijendran
    * @author Harish Prabandham
    */
  -public class JspEngineContext {
  +public class JspEngineContext implements JspCompilationContext {
       JspReader reader;
       ServletWriter writer;
       ServletContext context;
  @@ -187,7 +187,7 @@
        * other places it is called outputDir.
        */
       public String getOutputDir() {
  -        return options.scratchDir().toString();
  +        return options.getScratchDir().toString();
       }
       
       /**
  @@ -235,7 +235,7 @@
        * Are we keeping generated code around?
        */
       public boolean keepGenerated() {
  -        return options.keepGenerated();
  +        return options.getKeepGenerated();
       }
   
       /**
  @@ -312,4 +312,50 @@
            
           return jspCompiler;
       }
  +    
  +    /** 
  +     * Get the full value of a URI relative to this compilations context
  +     */
  +    public String resolveRelativeUri(String uri)
  +    {
  +        if (uri.charAt(0) == '/')
  +        {
  +            return uri;
  +        }
  +        else
  +        {
  +            String actURI =  req.getServletPath();
  +            String baseURI = actURI.substring(0, actURI.lastIndexOf('/'));
  +            return baseURI + '/' + uri;
  +       };
  +    };    
  +
  +    /**
  +     * Gets a resource as a stream, relative to the meanings of this
  +     * context's implementation.
  +     *@returns a null if the resource cannot be found or represented 
  +     *         as an InputStream.
  +     */
  +    public java.io.InputStream getResourceAsStream(String res)
  +    {
  +        return context.getResourceAsStream(res);
  +    };
  +
  +    /** 
  +     * Gets the actual path of a URI relative to the context of
  +     * the compilation.
  +     */
  +    public String getRealPath(String path)
  +    {
  +        if (context != null)
  +        {
  +            return context.getRealPath(path);
  +        }
  +        else
  +        {
  +            return path;
  +        };
  +    };
  +
  +   
   }
  
  
  
  1.8       +13 -187   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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Options.java	2000/01/21 04:17:21	1.7
  +++ Options.java	2000/01/24 05:54:50	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Options.java,v 1.7 2000/01/21 04:17:21 rubys Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/01/21 04:17:21 $
  + * $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 $
    *
    * ====================================================================
    * 
  @@ -72,228 +72,54 @@
    * @author Anil K. Vijendran
    * @author Hans Bergsten
    */
  -public final class Options {
  -    /**
  -     * Do you want to keep the generated Java files around?
  -     */
  -    public boolean keepGenerated = true;
  -
  -    /**
  -     * Do you want support for "large" files? What this essentially
  -     * means is that we generated code so that the HTML data in a JSP
  -     * file is stored separately as opposed to those constant string
  -     * data being used literally in the generated servlet. 
  -     */
  -    public boolean largeFile = false;
  +public interface Options {
   
       /**
  -     * Do you want stack traces and such displayed in the client's
  -     * browser? If this is false, such messages go to the standard
  -     * error or a log file if the standard error is redirected. 
  -     */
  -    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?
  -     */
  -    public File scratchDir;
  -    
  -    /**
  -     * Need to have this as is for versions 4 and 5 of IE. Can be set from
  -     * the initParams so if it changes in the future all that is needed is
  -     * to have a jsp initParam of type ieClassId="<value>"
  -     */
  -    public String ieClassId = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
  -
  -    /**
  -     * What classpath should I use while compiling generated servlets?
  -     */
  -    public String classpath = null;
  -    
  -    /**
  -     * Plugin class to use to compile JSP pages.
  -     */
  -    public Class jspCompilerPlugin = null;
  -    
  -    /**
  -     * Path of the compiler to use for compiling JSP pages.
  -     */
  -    public String jspCompilerPath = null;
  -
  -
  -    /**
        * Are we keeping generated code around?
        */
  -    public boolean keepGenerated() {
  -        return keepGenerated;
  -    }
  +    public boolean getKeepGenerated();
       
       /**
        * Are we supporting large files?
        */
  -    public boolean largeFile() {
  -        return largeFile;
  -    }
  +    public boolean getLargeFile();
       
       /**
        * Should errors be sent to client or thrown into stderr?
        */
  -    public boolean sendErrorToClient() {
  -        return sendErrorToClient;
  -    }
  +    public boolean getSendErrorToClient();
    
       /**
        * Class ID for use in the plugin tag when the browser is IE. 
        */
  -    public String ieClassId() {
  -        return ieClassId;
  -    }
  +    public String getIeClassId();
       
       /**
        * What is the current verbosity level?
        */
  -    public int jspVerbosityLevel() {
  -        return jspVerbosityLevel;
  -    }
  +    public int getJspVerbosityLevel();
   
       /**
        * What is my scratch dir?
        */
  -    public File scratchDir() {
  -        return scratchDir;
  -    }
  +    public File getScratchDir();
   
       /**
        * What classpath should I use while compiling the servlets
        * generated from JSP files?
        */
  -    public String getClassPath() {
  -        return classpath;
  -    }
  +    public String getClassPath();
   
       /**
        * What compiler plugin should I use to compile the servlets
        * generated from JSP files?
        */
  -    public Class getJspCompilerPlugin() {
  -        return jspCompilerPlugin;
  -    }
  +    public Class getJspCompilerPlugin();
   
       /**
        * Path of the compiler to use for compiling JSP pages.
        */
  -    public String getJspCompilerPath() {
  -	return jspCompilerPath;
  -    }
  -
  -    /**
  -     * Create an Options object using data available from
  -     * ServletConfig and ServletContext. 
  -     */
  -    public Options(ServletConfig config, ServletContext context) {
  -        String keepgen = config.getInitParameter("keepgenerated");
  -        if (keepgen != null) {
  -            if (keepgen.equalsIgnoreCase("true"))
  -                this.keepGenerated = true;
  -            else if (keepgen.equalsIgnoreCase("false"))
  -                this.keepGenerated = false;
  -            else Constants.message ("jsp.warning.keepgen", Constants.FATAL_ERRORS);
  -        }
  -            
  -
  -        String largeFile = config.getInitParameter("largefile"); 
  -        if (largeFile != null) {
  -            if (largeFile.equalsIgnoreCase("true"))
  -                this.largeFile = true;
  -            else if (largeFile.equalsIgnoreCase("false"))
  -                this.largeFile = false;
  -            else Constants.message ("jsp.warning.largeFile", Constants.FATAL_ERRORS);
  -        }
  -
  -        String senderr = config.getInitParameter("sendErrToClient");
  -        if (senderr != null) {
  -            if (senderr.equalsIgnoreCase("true"))
  -                this.sendErrorToClient = true;
  -            else if (senderr.equalsIgnoreCase("false"))
  -                this.sendErrorToClient = false;
  -            else Constants.message ("jsp.warning.sendErrToClient", Constants.FATAL_ERRORS);
  -        }
  -
  -        String ieClassId = config.getInitParameter("ieClassId");
  -        if (ieClassId != null)
  -            this.ieClassId = ieClassId;
  -
  -        String classpath = config.getInitParameter("classpath");
  -        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"); 
  +    public String getJspCompilerPath();
   
  -        if (dir != null)
  -            scratchDir = new File(dir);
  -        else {
  -            // First we try the Servlet 2.2 javax.servlet.context.tempdir property
  -            scratchDir = (File) context.getAttribute(Constants.TMP_DIR);
  -            if (scratchDir == null) {
  -                // Not running in a Servlet 2.2 container.
  -                // Try to get the JDK 1.2 java.io.tmpdir property
  -                dir = System.getProperty("java.io.tmpdir");
  -		if (dir != null)
  -                    scratchDir = new File(dir);
  -            }
  -        }
  -                
  -        if (this.scratchDir == null) {
  -            Constants.message("jsp.error.no.scratch.dir", Constants.FATAL_ERRORS);
  -            return;
  -        }
  -            
  -        if (!(scratchDir.exists() && scratchDir.canRead() &&
  -              scratchDir.canWrite() && scratchDir.isDirectory()))
  -            Constants.message("jsp.error.bad.scratch.dir",
  -                              new Object[] {
  -                                  scratchDir.getAbsolutePath()
  -                              }, Constants.FATAL_ERRORS);
  -				  
  -	String jspCompilerPath = config.getInitParameter("jspCompilerPath");
  -	if (jspCompilerPath != null) {
  -	    if (new File(jspCompilerPath).exists()) {
  -		this.jspCompilerPath = jspCompilerPath;
  -	    } else { 
  -		Constants.message("jsp.warning.compiler.path.notfound",
  -				  new Object[] { jspCompilerPath }, 
  -				  Constants.FATAL_ERRORS);
  -	    }
  -	}
  -  
  -	String jspCompilerPlugin = config.getInitParameter("jspCompilerPlugin");
  -	if (jspCompilerPlugin != null) {
  -            try {
  -                this.jspCompilerPlugin = Class.forName(jspCompilerPlugin);
  -            } catch (ClassNotFoundException cnfe) {
  -		Constants.message("jsp.warning.compiler.class.notfound",
  -				  new Object[] { jspCompilerPlugin }, 
  -				  Constants.FATAL_ERRORS);
  -	    }
  -	}
  -  
  -    }
   }
   
  
  
  
  1.1                  jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java
  
  Index: EmbededServletOptions.java
  ===================================================================
  /*
   * $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 $
   *
   * ====================================================================
   * 
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */ 
  
  package org.apache.jasper;
  
  import java.io.File;
  
  import javax.servlet.ServletConfig;
  import javax.servlet.ServletContext;
  
  /**
   * A class to hold all init parameters specific to the JSP engine. 
   *
   * @author Anil K. Vijendran
   * @author Hans Bergsten
   */
  public final class EmbededServletOptions implements Options {
      /**
       * Do you want to keep the generated Java files around?
       */
      public boolean keepGenerated = true;
  
      /**
       * Do you want support for "large" files? What this essentially
       * means is that we generated code so that the HTML data in a JSP
       * file is stored separately as opposed to those constant string
       * data being used literally in the generated servlet. 
       */
      public boolean largeFile = false;
  
      /**
       * Do you want stack traces and such displayed in the client's
       * browser? If this is false, such messages go to the standard
       * error or a log file if the standard error is redirected. 
       */
      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?
       */
      public File scratchDir;
      
      /**
       * Need to have this as is for versions 4 and 5 of IE. Can be set from
       * the initParams so if it changes in the future all that is needed is
       * to have a jsp initParam of type ieClassId="<value>"
       */
      public String ieClassId = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
  
      /**
       * What classpath should I use while compiling generated servlets?
       */
      public String classpath = null;
      
      /**
       * Plugin class to use to compile JSP pages.
       */
      public Class jspCompilerPlugin = null;
  
      /**
       * Path of the compiler to use for compiling JSP pages.
       */
      public String jspCompilerPath = null;
  
  
      /**
       * Are we keeping generated code around?
       */
      public boolean getKeepGenerated() {
          return keepGenerated;
      }
      
      /**
       * Are we supporting large files?
       */
      public boolean getLargeFile() {
          return largeFile;
      }
      
      /**
       * Should errors be sent to client or thrown into stderr?
       */
      public boolean getSendErrorToClient() {
          return sendErrorToClient;
      }
   
      /**
       * Class ID for use in the plugin tag when the browser is IE. 
       */
      public String getIeClassId() {
          return ieClassId;
      }
      
      /**
       * What is the current verbosity level?
       */
      public int getJspVerbosityLevel() {
          return jspVerbosityLevel;
      }
  
      /**
       * What is my scratch dir?
       */
      public File getScratchDir() {
          return scratchDir;
      }
  
      /**
       * What classpath should I use while compiling the servlets
       * generated from JSP files?
       */
      public String getClassPath() {
          return classpath;
      }
  
      /**
       * What compiler plugin should I use to compile the servlets
       * generated from JSP files?
       */
      public Class getJspCompilerPlugin() {
          return jspCompilerPlugin;
      }
  
      /**
       * Path of the compiler to use for compiling JSP pages.
       */
      public String getJspCompilerPath() {
          return jspCompilerPath;
      }
  
      /**
       * Create an EmbededServletOptions object using data available from
       * ServletConfig and ServletContext. 
       */
      public EmbededServletOptions(ServletConfig config, ServletContext context) {
          String keepgen = config.getInitParameter("keepgenerated");
          if (keepgen != null) {
              if (keepgen.equalsIgnoreCase("true"))
                  this.keepGenerated = true;
              else if (keepgen.equalsIgnoreCase("false"))
                  this.keepGenerated = false;
              else Constants.message ("jsp.warning.keepgen", Constants.FATAL_ERRORS);
          }
              
  
          String largeFile = config.getInitParameter("largefile"); 
          if (largeFile != null) {
              if (largeFile.equalsIgnoreCase("true"))
                  this.largeFile = true;
              else if (largeFile.equalsIgnoreCase("false"))
                  this.largeFile = false;
              else Constants.message ("jsp.warning.largeFile", Constants.FATAL_ERRORS);
          }
  
          String senderr = config.getInitParameter("sendErrToClient");
          if (senderr != null) {
              if (senderr.equalsIgnoreCase("true"))
                  this.sendErrorToClient = true;
              else if (senderr.equalsIgnoreCase("false"))
                  this.sendErrorToClient = false;
              else Constants.message ("jsp.warning.sendErrToClient", Constants.FATAL_ERRORS);
          }
  
          String ieClassId = config.getInitParameter("ieClassId");
          if (ieClassId != null)
              this.ieClassId = ieClassId;
  
          String classpath = config.getInitParameter("classpath");
          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)
              scratchDir = new File(dir);
          else {
              // First we try the Servlet 2.2 javax.servlet.context.tempdir property
              scratchDir = (File) context.getAttribute(Constants.TMP_DIR);
              if (scratchDir == null) {
                  // Not running in a Servlet 2.2 container.
                  // Try to get the JDK 1.2 java.io.tmpdir property
                  dir = System.getProperty("java.io.tmpdir");
                  if (dir != null)
                      scratchDir = new File(dir);
              }
          }
                  
          if (this.scratchDir == null) {
              Constants.message("jsp.error.no.scratch.dir", Constants.FATAL_ERRORS);
              return;
          }
              
          if (!(scratchDir.exists() && scratchDir.canRead() &&
                scratchDir.canWrite() && scratchDir.isDirectory()))
              Constants.message("jsp.error.bad.scratch.dir",
                                new Object[] {
                                    scratchDir.getAbsolutePath()
                                }, Constants.FATAL_ERRORS);
                                    
          String jspCompilerPath = config.getInitParameter("jspCompilerPath");
          if (jspCompilerPath != null) {
              if (new File(jspCompilerPath).exists()) {
                  this.jspCompilerPath = jspCompilerPath;
              } else { 
                  Constants.message("jsp.warning.compiler.path.notfound",
                                    new Object[] { jspCompilerPath }, 
                                    Constants.FATAL_ERRORS);
              }
          }
  
          String jspCompilerPlugin = config.getInitParameter("jspCompilerPlugin");
          if (jspCompilerPlugin != null) {
              try {
                  this.jspCompilerPlugin = Class.forName(jspCompilerPlugin);
              } catch (ClassNotFoundException cnfe) {
                  Constants.message("jsp.warning.compiler.class.notfound",
                                    new Object[] { jspCompilerPlugin },
                                    Constants.FATAL_ERRORS);
              }
          }
    
      }
  }
  
  
  
  
  1.1                  jakarta-tomcat/src/share/org/apache/jasper/JspCompilationContext.java
  
  Index: JspCompilationContext.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspCompilationContext.java,v 1.1 2000/01/24 05:54:50 shemnon Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/24 05:54:50 $
   *
   * ====================================================================
   * 
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */ 
  
  
  
  
  
  package org.apache.jasper;
  
  import org.apache.jasper.compiler.JspReader;
  import org.apache.jasper.compiler.ServletWriter;
  import org.apache.jasper.runtime.JspLoader;
  import org.apache.jasper.compiler.TagLibraries;
  
  import org.apache.jasper.compiler.Compiler;
  import org.apache.jasper.compiler.JspCompiler;
  import org.apache.jasper.compiler.SunJavaCompiler;
  import org.apache.jasper.compiler.PluginJavaCompiler;
  
  /**
   * 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
   * the instance variables are set at different points.
   *
   * JspLoader creates this object and passes this off to the "compiler"
   * subsystem, which then initializes the rest of the variables. 
   *
   * @author Anil K. Vijendran
   * @author Harish Prabandham
   */
  public interface JspCompilationContext {
  
      /**
       * The classpath that is passed off to the Java compiler. 
       */
      public String getClassPath();
      
      /**
       * Get the input reader for the JSP text. 
       */
      public JspReader getReader();
      
      /**
       * Where is the servlet being generated?
       */
      public ServletWriter getWriter();
      
      /**
       * What class loader to use for loading classes while compiling
       * this JSP? I don't think this is used right now -- akv. 
       */
      public JspLoader getClassLoader();
      
      /**
       * Are we processing something that has been declared as an
       * errorpage? 
       */
      public boolean isErrorPage();
      
      /**
       * What is the scratch directory we are generating code into?
       * FIXME: In some places this is called scratchDir and in some
       * other places it is called outputDir.
       */
      public String getOutputDir();
      
      /**
       * Path of the JSP URI. Note that this is not a file name. This is
       * the context rooted URI of the JSP file. 
       */
      public String getJspFile();
      
      /**
       * Just the class name (does not include package name) of the
       * generated class. 
       */
      public String getServletClassName();
      
      /**
       * The package name into which the servlet class is generated. 
       */
      public String getServletPackageName();
  
      /**
       * Utility method to get the full class name from the package and
       * class name. 
       */
      public String getFullClassName();
  
      /**
       * Full path name of the Java file into which the servlet is being
       * generated. 
       */
      public String getServletJavaFileName();
  
      /**
       * Are we keeping generated code around?
       */
      public boolean keepGenerated();
  
      /**
       * What's the content type of this JSP? Content type includes
       * content type and encoding. 
       */
      public String getContentType();
  
      /**
       * Get hold of the Options object for this context. 
       */
      public Options getOptions();
  
      public void setContentType(String contentType);
  
      public void setReader(JspReader reader);
      
      public void setWriter(ServletWriter writer);
      
      public void setServletClassName(String servletClassName);
      
      public void setServletPackageName(String servletPackageName);
      
      public void setServletJavaFileName(String servletJavaFileName);
      
      public void setErrorPage(boolean isErrPage);
  
      /**
       * Create a "Compiler" object based on some init param data. This
       * is not done yet. Right now we're just hardcoding the actual
       * compilers that are created. 
       */
      public Compiler createCompiler() throws JasperException;
  
  
      /** 
       * Get the full value of a URI relative to this compilations context
       */
      public String resolveRelativeUri(String uri);
  
      /**
       * Gets a resource as a stream, relative to the meanings of this
       * context's implementation.
       *@returns a null if the resource cannot be found or represented 
       *         as an InputStream.
       */
      public java.io.InputStream getResourceAsStream(String res);
  
      /** 
       * Gets the actual path of a URI relative to the context of
       * the compilation.
       */
      public String getRealPath(String path);
  
  }
  
  
  
  
  1.8       +7 -7      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Compiler.java	2000/01/21 04:17:21	1.7
  +++ Compiler.java	2000/01/24 05:54:50	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v 1.7 2000/01/21 04:17:21 rubys Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/01/21 04:17:21 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v 1.8 2000/01/24 05:54:50 shemnon Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/01/24 05:54:50 $
    *
    * ====================================================================
    * 
  @@ -66,7 +66,7 @@
   import java.io.ByteArrayOutputStream;
   import java.io.FileOutputStream;
   
  -import org.apache.jasper.JspEngineContext;
  +import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.Constants;
   import org.apache.jasper.JasperException;
   
  @@ -83,9 +83,9 @@
   public abstract class Compiler {
       protected JavaCompiler javac;
       protected Mangler mangler;
  -    protected JspEngineContext ctxt;
  +    protected JspCompilationContext ctxt;
   
  -    protected Compiler(JspEngineContext ctxt) {
  +    protected Compiler(JspCompilationContext ctxt) {
           this.ctxt = ctxt;
       }
       
  @@ -134,7 +134,7 @@
   
           JspReader reader = JspReader.createJspReader(
               ctxt.getJspFile(),
  -            ctxt.getServletContext(),
  +            ctxt,
               jspEncoding
           );
   
  
  
  
  1.3       +5 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Generator.java	1999/10/20 11:22:53	1.2
  +++ Generator.java	2000/01/24 05:54:50	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Generator.java,v 1.2 1999/10/20 11:22:53 akv Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/20 11:22:53 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Generator.java,v 1.3 2000/01/24 05:54:50 shemnon Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/01/24 05:54:50 $
    *
    * ====================================================================
    * 
  @@ -61,7 +61,7 @@
   package org.apache.jasper.compiler;
   
   import org.apache.jasper.JasperException;
  -import org.apache.jasper.JspEngineContext;
  +import org.apache.jasper.JspCompilationContext;
   
   /**
    * Interface that all generators implement. 
  @@ -71,5 +71,5 @@
   public interface Generator {
       void generate (ServletWriter out, Class phase) throws JasperException;
       boolean generateCoordinates(Class phase);
  -    void init(JspEngineContext ctxt) throws JasperException;
  +    void init(JspCompilationContext ctxt) throws JasperException;
   }
  
  
  
  1.3       +6 -6      jakarta-tomcat/src/share/org/apache/jasper/compiler/GeneratorBase.java
  
  Index: GeneratorBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/GeneratorBase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GeneratorBase.java	1999/10/20 11:22:53	1.2
  +++ GeneratorBase.java	2000/01/24 05:54:51	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/GeneratorBase.java,v 1.2 1999/10/20 11:22:53 akv Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/20 11:22:53 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/GeneratorBase.java,v 1.3 2000/01/24 05:54:51 shemnon Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/01/24 05:54:51 $
    *
    * ====================================================================
    * 
  @@ -61,7 +61,7 @@
   
   package org.apache.jasper.compiler;
   
  -import org.apache.jasper.JspEngineContext;
  +import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.JasperException;
   
   /**
  @@ -70,9 +70,9 @@
    * @author Anil K. Vijendran
    */
   abstract class GeneratorBase implements Generator {
  -    protected JspEngineContext ctxt;
  +    protected JspCompilationContext ctxt;
   
  -    public void init(JspEngineContext ctxt) throws JasperException {
  +    public void init(JspCompilationContext ctxt) throws JasperException {
           this.ctxt = ctxt;
       }
       
  
  
  
  1.5       +7 -9      jakarta-tomcat/src/share/org/apache/jasper/compiler/JspCompiler.java
  
  Index: JspCompiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspCompiler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JspCompiler.java	1999/12/28 16:25:54	1.4
  +++ JspCompiler.java	2000/01/24 05:54:51	1.5
  @@ -58,9 +58,7 @@
   import java.io.File;
   import java.io.FileNotFoundException;
   
  -import javax.servlet.ServletContext;
  -
  -import org.apache.jasper.JspEngineContext;
  +import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.Constants;
   import org.apache.jasper.JasperException;
   
  @@ -81,7 +79,7 @@
       boolean outDated;
   
   
  -    public JspCompiler(JspEngineContext ctxt) throws JasperException {
  +    public JspCompiler(JspCompilationContext ctxt) throws JasperException {
           super(ctxt);
           
           this.jsp = new File(ctxt.getJspFile());
  @@ -254,14 +252,14 @@
       private final void computeClassFileData()
   	throws JasperException
       {
  -        ServletContext ctx = ctxt.getServletContext();
  -        
   	File jspReal = null;
   
  -        if (ctx != null) 
  -            jspReal = new File(ctx.getRealPath(jsp.getPath()));
  -        else
  +        String initPath = jsp.getPath();
  +        String convPath = ctxt.getRealPath(initPath);
  +        if (convPath.equals(initPath))
               jspReal = jsp;
  +        else
  +            jspReal = new File(ctxt.getRealPath(jsp.getPath()));
   
           File classFile = new File(classFileName);
           
  
  
  
  1.6       +10 -12    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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JspParseEventListener.java	1999/12/21 16:32:31	1.5
  +++ JspParseEventListener.java	2000/01/24 05:54:51	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v 1.5 1999/12/21 16:32:31 rubys Exp $
  - * $Revision: 1.5 $
  - * $Date: 1999/12/21 16:32:31 $
  + * $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 $
    *
    * ====================================================================
    * 
  @@ -73,14 +73,12 @@
   import java.net.URL;
   import java.net.MalformedURLException;
   
  -import javax.servlet.ServletContext;
  -
   import javax.servlet.jsp.tagext.TagInfo;
   import javax.servlet.jsp.tagext.TagLibraryInfo;
   
   import org.apache.jasper.JasperException;
   import org.apache.jasper.Constants;
  -import org.apache.jasper.JspEngineContext;
  +import org.apache.jasper.JspCompilationContext;
   
   /**
    * JSP code generator "backend". 
  @@ -89,7 +87,7 @@
    */
   public class JspParseEventListener extends BaseJspListener {
   
  -    JspEngineContext ctxt;
  +    JspCompilationContext ctxt;
       
       String jspServletBase = Constants.JSP_SERVLET_BASE;
       String serviceMethodName = Constants.SERVICE_METHOD_NAME;
  @@ -135,14 +133,14 @@
        * Package private since I want everyone to come in through 
        * org.apache.jasper.compiler.Main.
        */ 
  -    JspParseEventListener(JspEngineContext ctxt) {
  +    JspParseEventListener(JspCompilationContext ctxt) {
   	super(ctxt.getReader(), ctxt.getWriter());
           this.ctxt = ctxt;
   	this.beanInfo = new BeanRepository(ctxt.getClassLoader());
           this.libraries = new TagLibraries(ctxt.getClassLoader());
           
           // FIXME: Is this good enough? (I'm just taking the easy way out - akv)
  -        if (ctxt.getOptions().largeFile())
  +        if (ctxt.getOptions().getLargeFile())
               dataFile = ctxt.getOutputDir() + File.separatorChar + 
                   ctxt.getServletPackageName() + "_" + 
                   ctxt.getServletClassName() + ".dat";
  @@ -159,7 +157,7 @@
   	generateAll(ServiceMethodPhase.class);
   	writer.println();
   	generateFooter();
  -        if (ctxt.getOptions().largeFile())
  +        if (ctxt.getOptions().getLargeFile())
               try {
                   ObjectOutputStream o 
                       = new ObjectOutputStream(new FileOutputStream(dataFile));
  @@ -695,7 +693,7 @@
               return generator.generateCoordinates(phase);
           }
   
  -        public void init(JspEngineContext ctxt) 
  +        public void init(JspCompilationContext ctxt) 
               throws JasperException 
           {
               generator.init(ctxt);
  @@ -833,7 +831,7 @@
       
       public void handleCharData(char[] chars) throws JasperException {
           GeneratorBase cdg;
  -        if (ctxt.getOptions().largeFile())
  +        if (ctxt.getOptions().getLargeFile())
               cdg = new StoredCharDataGenerator(vector, dataFile, stringId++, chars);
           else
               cdg = new CharDataGenerator(chars);
  
  
  
  1.10      +5 -7      jakarta-tomcat/src/share/org/apache/jasper/compiler/JspReader.java
  
  Index: JspReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspReader.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JspReader.java	2000/01/08 21:31:38	1.9
  +++ JspReader.java	2000/01/24 05:54:51	1.10
  @@ -68,10 +68,8 @@
   import java.util.Vector;
   import java.util.Stack;
   
  -import javax.servlet.ServletContext;
  -
  -
   import org.apache.jasper.Constants;
  +import org.apache.jasper.JspCompilationContext;
   
   /**
    * JspReader is an input buffer for the JSP parser. It should allow
  @@ -90,8 +88,8 @@
       Vector sourceFiles = new Vector();
       int size = 0;
       
  -    private ServletContext context;
  -
  +    private JspCompilationContext context;
  +    
       public String getFile(int fileid) {
   	return (String) sourceFiles.elementAt(fileid);
       }
  @@ -210,14 +208,14 @@
   	return current.popStream();
       }
   	
  -    protected JspReader(String file, ServletContext ctx, String encoding) 
  +    protected JspReader(String file, JspCompilationContext ctx, String encoding) 
   	throws ParseException, FileNotFoundException
       {
           this.context = ctx;
   	pushFile(file, encoding);
       }
   
  -    public static JspReader createJspReader(String file, ServletContext ctx, String encoding) 
  +    public static JspReader createJspReader(String file, JspCompilationContext ctx, String encoding) 
   	throws ParseException, FileNotFoundException
       {
   	return new JspReader(file, ctx, encoding);
  
  
  
  1.3       +6 -6      jakarta-tomcat/src/share/org/apache/jasper/compiler/PluginGenerator.java
  
  Index: PluginGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/PluginGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PluginGenerator.java	1999/10/20 11:22:54	1.2
  +++ PluginGenerator.java	2000/01/24 05:54:51	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/PluginGenerator.java,v 1.2 1999/10/20 11:22:54 akv Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/20 11:22:54 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/PluginGenerator.java,v 1.3 2000/01/24 05:54:51 shemnon Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/01/24 05:54:51 $
    *
    * ====================================================================
    * 
  @@ -66,7 +66,7 @@
   
   import org.apache.jasper.JasperException;
   import org.apache.jasper.Constants;
  -import org.apache.jasper.JspEngineContext;
  +import org.apache.jasper.JspCompilationContext;
   
   /**
    * Generator for <jsp:plugin>
  @@ -90,8 +90,8 @@
   	this.fallback = fallback;
       }
   
  -    public void init(JspEngineContext ctxt) throws JasperException {
  -        ieClassId = ctxt.getOptions().ieClassId();
  +    public void init(JspCompilationContext ctxt) throws JasperException {
  +        ieClassId = ctxt.getOptions().getIeClassId();
       }
       
       public void generate(ServletWriter writer, Class phase) 
  
  
  
  1.9       +2 -2      jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java
  
  Index: TagBeginGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TagBeginGenerator.java	2000/01/24 02:22:06	1.8
  +++ TagBeginGenerator.java	2000/01/24 05:54:51	1.9
  @@ -68,7 +68,7 @@
   import javax.servlet.jsp.tagext.BodyTag;
   
   import org.apache.jasper.JasperException;
  -import org.apache.jasper.JspEngineContext;
  +import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.Constants;
   
   import org.apache.jasper.compiler.ServletWriter;
  @@ -107,7 +107,7 @@
   	this.thVarName = "_jspx_th_"+baseVarName;
       }
   
  -    public void init(JspEngineContext ctxt) throws JasperException {
  +    public void init(JspCompilationContext ctxt) throws JasperException {
           validate();
           tc = tli.getTagCache(shortTagName);
           if (tc == null) {
  
  
  
  1.10      +11 -15    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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TagLibraryInfoImpl.java	1999/11/24 01:11:00	1.9
  +++ TagLibraryInfoImpl.java	2000/01/24 05:54:51	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v 1.9 1999/11/24 01:11:00 mandar Exp $
  - * $Revision: 1.9 $
  - * $Date: 1999/11/24 01:11:00 $
  + * $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 $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -78,14 +78,13 @@
   import javax.servlet.jsp.tagext.TagInfo;
   import javax.servlet.jsp.tagext.TagAttributeInfo;
   import javax.servlet.jsp.tagext.TagExtraInfo;
  -import javax.servlet.http.HttpServletRequest;
   
   import org.w3c.dom.*;
   import org.xml.sax.*;
   import com.sun.xml.tree.*;
   import com.sun.xml.parser.*;
   
  -import org.apache.jasper.JspEngineContext;
  +import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.JasperException;
   import org.apache.jasper.Constants;
   import org.apache.jasper.runtime.JspLoader;
  @@ -105,7 +104,7 @@
       Hashtable jarEntries;
       Hashtable tagCaches = new Hashtable();
       
  -    JspEngineContext ctxt;
  +    JspCompilationContext ctxt;
   
       
   
  @@ -132,7 +131,7 @@
           return sw.toString();
       }
       
  -    TagLibraryInfoImpl(JspEngineContext ctxt, String prefix, String uriIn) 
  +    TagLibraryInfoImpl(JspCompilationContext ctxt, String prefix, String uriIn) 
           throws IOException, JasperException
       {
   	// XXX. should super be initialized with "dummy" uri?
  @@ -147,7 +146,7 @@
   
   	if (!uriIn.endsWith("jar")) {
   	    // Parse web.xml.
  -	    InputStream is = ctxt.getServletContext().getResourceAsStream(WEBAPP_INF);
  +	    InputStream is = ctxt.getResourceAsStream(WEBAPP_INF);
   	    
   	    if (is != null) {
   	    
  @@ -195,14 +194,11 @@
   
   	    // "uri" should point to the correct tld location.
   	    if (!uri.startsWith("/")) {
  -		HttpServletRequest request = ctxt.getRequest();
  -		String actURI =  request.getServletPath();
  -		String baseURI = actURI.substring(0, actURI.lastIndexOf('/'));
  -		uri = baseURI + '/' + uri;
  +		uri = ctxt.resolveRelativeUri(uri);
   	    }
   	    //else {
   	    //relativeURL = true;
  -	    in = ctxt.getServletContext().getResourceAsStream(uri);
  +	    in = ctxt.getResourceAsStream(uri);
   	    //}
   	    
   	    if (in == null)
  @@ -220,7 +216,7 @@
   		in = url.openStream();
   	    } else {
   		relativeURL = true;
  -		in = ctxt.getServletContext().getResourceAsStream(uriIn);
  +		in = ctxt.getResourceAsStream(uriIn);
   	    }
   	    
   	    zin = new ZipInputStream(in);
  @@ -246,7 +242,7 @@
   				  Constants.MED_VERBOSITY);
   	    
   		if (relativeURL)
  -		    copy(ctxt.getServletContext().getResourceAsStream(uri),
  +		    copy(ctxt.getResourceAsStream(uri),
   			 jarFileName);
   		else
   		    copy(url.openStream(), jarFileName);
  
  
  
  1.4       +6 -5      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JspLoader.java	1999/12/21 12:34:31	1.3
  +++ JspLoader.java	2000/01/24 05:54:52	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java,v 1.3 1999/12/21 12:34:31 rubys Exp $
  - * $Revision: 1.3 $
  - * $Date: 1999/12/21 12:34:31 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspLoader.java,v 1.4 2000/01/24 05:54:52 shemnon Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/01/24 05:54:52 $
    *
    * ====================================================================
    * 
  @@ -79,6 +79,7 @@
   
   import org.apache.jasper.JasperException;
   import org.apache.jasper.Constants;
  +import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.JspEngineContext;
   import org.apache.jasper.Options;
   import org.apache.jasper.compiler.Compiler;
  @@ -165,7 +166,7 @@
                   return defClass(className, classBytes);
   	    } else {
                   String fileName = null;
  -                String outputDir = options.scratchDir().toString();
  +                String outputDir = options.getScratchDir().toString();
               
                   if (className.indexOf('$', end) != -1) {
                       // this means we're loading an inner class
  @@ -214,7 +215,7 @@
   	Class jspClass = (Class) loadedJSPs.get(name);
   	boolean firstTime = jspClass == null;
   
  -        JspEngineContext ctxt = new JspEngineContext(this, classpath,
  +        JspCompilationContext ctxt = new JspEngineContext(this, classpath,
                                                        context, name, 
                                                        isErrorPage, options,
                                                        req, res);
  
  
  
  1.14      +7 -6      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JspServlet.java	2000/01/18 03:48:45	1.13
  +++ JspServlet.java	2000/01/24 05:54:52	1.14
  @@ -76,6 +76,7 @@
   import org.apache.jasper.JasperException;
   import org.apache.jasper.Constants;
   import org.apache.jasper.Options;
  +import org.apache.jasper.EmbededServletOptions;
   
   
   /**
  @@ -202,7 +203,7 @@
           if (engine == null)
               Constants.message("jsp.error.bad-servlet-engine", Constants.FATAL_ERRORS);
           else {
  -            options = new Options(config, context);
  +            options = new EmbededServletOptions(config, context);
   
               parentClassLoader = (ClassLoader) context.getAttribute(Constants.SERVLET_CLASS_LOADER);
               if (parentClassLoader == null)
  @@ -229,7 +230,7 @@
                   firstTime = false;
                   Constants.message("jsp.message.scratch.dir.is", 
                                     new Object[] { 
  -                                      options.scratchDir().toString() 
  +                                      options.getScratchDir().toString() 
                                     }, Constants.LOW_VERBOSITY );
                   Constants.message("jsp.message.dont.modify.servlets", Constants.LOW_VERBOSITY);
               }
  @@ -260,7 +261,7 @@
       						Throwable t) 
       {
       	PrintWriter writer = new PrintWriter(System.err, true);
  -	if (options.sendErrorToClient()) {
  +	if (options.getSendErrorToClient()) {
   	    try {
   	        response.setContentType ("text/html");
   	    	writer = response.getWriter ();
  @@ -270,7 +271,7 @@
   	}
           writer.println(Constants.getString("jsp.error.unknownException"));
   
  -        if (options.sendErrorToClient()) {
  +        if (options.getSendErrorToClient()) {
               writer.println("<pre>");
           }
   
  @@ -281,11 +282,11 @@
   	    t.printStackTrace (writer);
   	}
   
  -        if (options.sendErrorToClient()) {
  +        if (options.getSendErrorToClient()) {
               writer.println("</pre>");
           }
           
  -	if (!options.sendErrorToClient()) {
  +	if (!options.getSendErrorToClient()) {
               try {
   	        String message = t.getMessage ();
   		if (message == null)
  
  
  

Mime
View raw message