pierred     00/11/06 12:52:31

  Modified:    jasper/src/share/org/apache/jasper CommandLineContext.java
                        EmbededServletOptions.java JspC.java
                        JspCompilationContext.java JspEngineContext.java
                        Options.java
               jasper/src/share/org/apache/jasper/compiler
                        JspParseEventListener.java TagLibraryInfoImpl.java
               jasper/src/share/org/apache/jasper/servlet JspServlet.java
  Removed:     jasper/src/share/org/apache/jasper/compiler
                        TagLibrariesGlobal.java
  Log:
  Bug fix: TagLibrariesGlobal was shared by all web-apps while
           it is meant to be unique within each web-app.
  
  Took the opportunity to rename TagLibrariesGlobal to TldLocationsCache
  which represents better what it is meant for.
  
  Revision  Changes    Path
  1.4       +10 -4     
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/CommandLineContext.java
  
  Index: CommandLineContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/CommandLineContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CommandLineContext.java   2000/10/31 22:54:09     1.3
  +++ CommandLineContext.java   2000/11/06 20:52:18     1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/CommandLineContext.java,v
 1.3 2000/10/31 22:54:09 pierred Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/10/31 22:54:09 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/CommandLineContext.java,v
 1.4 2000/11/06 20:52:18 pierred Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/11/06 20:52:18 $
    *
    * ====================================================================
    * 
  @@ -84,7 +84,8 @@
    * over to other pages being compiled.  Things like the taglib classloaders
    * and directives.
    *
  - *@author Danno Ferrin
  + * @author Danno Ferrin
  + * @author Pierre Delisle
    */
   public class CommandLineContext implements JspCompilationContext {
   
  @@ -391,5 +392,10 @@
           return f.getAbsolutePath();
       }
   
  +    public String[] getTldLocation(String uri) throws JasperException {
  +     String[] location = 
  +         options.getTldLocationsCache().getLocation(uri);
  +     return location;
  +    }
   }
   
  
  
  
  1.4       +19 -3     
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/EmbededServletOptions.java
  
  Index: EmbededServletOptions.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/EmbededServletOptions.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EmbededServletOptions.java        2000/10/12 23:34:11     1.3
  +++ EmbededServletOptions.java        2000/11/06 20:52:18     1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/EmbededServletOptions.java,v
 1.3 2000/10/12 23:34:11 pierred Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/10/12 23:34:11 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/EmbededServletOptions.java,v
 1.4 2000/11/06 20:52:18 pierred Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/11/06 20:52:18 $
    *
    * ====================================================================
    * 
  @@ -68,11 +68,14 @@
   
   import org.apache.jasper.logging.Logger;
   
  +import org.apache.jasper.compiler.TldLocationsCache;
  +
   /**
    * A class to hold all init parameters specific to the JSP engine. 
    *
    * @author Anil K. Vijendran
    * @author Hans Bergsten
  + * @author Pierre Delisle
    */
   public final class EmbededServletOptions implements Options {
       /**
  @@ -136,6 +139,11 @@
       public String jspCompilerPath = null;
   
       /**
  +     * Cache for the TLD locations
  +     */
  +    private TldLocationsCache tldLocationsCache = null;
  +
  +    /**
        * Are we keeping generated code around?
        */
       public boolean getKeepGenerated() {
  @@ -206,6 +214,10 @@
           return jspCompilerPath;
       }
   
  +    public TldLocationsCache getTldLocationsCache() {
  +     return tldLocationsCache;
  +    }
  +
       /**
        * Create an EmbededServletOptions object using data available from
        * ServletConfig and ServletContext. 
  @@ -308,6 +320,10 @@
                                     Logger.FATAL);
               }
           }
  +
  +     // Setup the global Tag Libraries location cache for this
  +     // web-application.
  +     tldLocationsCache = new TldLocationsCache(context);
       }
   }
   
  
  
  
  1.6       +15 -3     jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JspC.java 2000/10/12 23:34:12     1.5
  +++ JspC.java 2000/11/06 20:52:19     1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspC.java,v 1.5 
2000/10/12 23:34:12 pierred Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/10/12 23:34:12 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspC.java,v 1.6 
2000/11/06 20:52:19 pierred Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/11/06 20:52:19 $
    *
    * ====================================================================
    * 
  @@ -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.TldLocationsCache;
   
   //import org.apache.jasper.runtime.JspLoader;
   import org.apache.jasper.servlet.JasperLoader;
  @@ -80,7 +81,9 @@
    * 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 Pierre Delisle
    */
   public class JspC implements Options { //, JspCompilationContext {
   
  @@ -148,6 +151,11 @@
   
       Vector extensions;
   
  +    /**
  +     * Cache for the TLD locations
  +     */
  +    private TldLocationsCache tldLocationsCache = null;
  +
       public boolean getKeepGenerated() {
           // isn't this why we are running jspc?
           return true;
  @@ -198,6 +206,10 @@
       public String getJspCompilerPath() {
          // we don't compile, so this is meanlingless
           return null;
  +    }
  +
  +    public TldLocationsCache getTldLocationsCache() {
  +     return tldLocationsCache;
       }
   
       public String getClassPath() {
  
  
  
  1.3       +20 -3     
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspCompilationContext.java
  
  Index: JspCompilationContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspCompilationContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JspCompilationContext.java        2000/10/31 22:54:09     1.2
  +++ JspCompilationContext.java        2000/11/06 20:52:19     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspCompilationContext.java,v
 1.2 2000/10/31 22:54:09 pierred Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/10/31 22:54:09 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspCompilationContext.java,v
 1.3 2000/11/06 20:52:19 pierred Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/11/06 20:52:19 $
    *
    * ====================================================================
    * 
  @@ -84,6 +84,7 @@
    *
    * @author Anil K. Vijendran
    * @author Harish Prabandham
  + * @author Pierre Delisle
    */
   public interface JspCompilationContext {
   
  @@ -215,5 +216,21 @@
   
       static interface Interface1 {
       }
  +
  +    /**
  +     * Get the 'location' of the TLD associated with 
  +     * a given taglib 'uri'.
  +     * 
  +     * @returns An array of two Strings. The first one is
  +     * real path to the TLD. If the path to the TLD points
  +     * to a jar file, then the second string is the
  +     * name of the entry for the TLD in the jar file.
  +     * Returns null if the uri is not associated to
  +     * a tag library 'exposed' in the web application.
  +     * A tag library is 'exposed' either explicitely in 
  +     * web.xml or implicitely via the uri tag in the TLD 
  +     * of a taglib deployed in a jar file (WEB-INF/lib).
  +     */
  +    public String[] getTldLocation(String uri) throws JasperException;
   }
   
  
  
  
  1.3       +9 -4      
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspEngineContext.java
  
  Index: JspEngineContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspEngineContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JspEngineContext.java     2000/10/31 22:54:10     1.2
  +++ JspEngineContext.java     2000/11/06 20:52:20     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspEngineContext.java,v
 1.2 2000/10/31 22:54:10 pierred Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/10/31 22:54:10 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspEngineContext.java,v
 1.3 2000/11/06 20:52:20 pierred Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/11/06 20:52:20 $
    *
    * ====================================================================
    * 
  @@ -94,6 +94,7 @@
    *
    * @author Anil K. Vijendran
    * @author Harish Prabandham
  + * @author Pierre Delisle
    */
   public class JspEngineContext implements JspCompilationContext {
       JspReader reader;
  @@ -372,5 +373,9 @@
           }
       }
   
  -   
  +    public String[] getTldLocation(String uri) throws JasperException {
  +     String[] location = 
  +         options.getTldLocationsCache().getLocation(uri);
  +     return location;
  +    }
   }
  
  
  
  1.4       +19 -3     
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/Options.java
  
  Index: Options.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/Options.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Options.java      2000/10/12 23:34:12     1.3
  +++ Options.java      2000/11/06 20:52:20     1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/Options.java,v 1.3 
2000/10/12 23:34:12 pierred Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/10/12 23:34:12 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/Options.java,v 1.4 
2000/11/06 20:52:20 pierred Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/11/06 20:52:20 $
    *
    * ====================================================================
    * 
  @@ -66,11 +66,14 @@
   import javax.servlet.ServletConfig;
   import javax.servlet.ServletContext;
   
  +import org.apache.jasper.compiler.TldLocationsCache;
  +
   /**
    * A class to hold all init parameters specific to the JSP engine. 
    *
    * @author Anil K. Vijendran
    * @author Hans Bergsten
  + * @author Pierre Delisle
    */
   public interface Options {
       /**
  @@ -125,4 +128,17 @@
        * ProtectionDomain for this JSP Context when using a SecurityManager
        */
       public Object getProtectionDomain();
  +
  +    /**
  +     * The cache for the location of the TLD's
  +     * for the various tag libraries 'exposed'
  +     * by the web application.
  +     * A tag library is 'exposed' either explicitely in 
  +     * web.xml or implicitely via the uri tag in the TLD 
  +     * of a taglib deployed in a jar file (WEB-INF/lib).
  +     *
  +     * @returns the instance of the TldLocationsCache
  +     * for the web-application.
  +     */
  +    public TldLocationsCache getTldLocationsCache();
   }
  
  
  
  1.11      +4 -4      
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java
  
  Index: JspParseEventListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JspParseEventListener.java        2000/10/31 22:54:11     1.10
  +++ JspParseEventListener.java        2000/11/06 20:52:26     1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
 1.10 2000/10/31 22:54:11 pierred Exp $
  - * $Revision: 1.10 $
  - * $Date: 2000/10/31 22:54:11 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
 1.11 2000/11/06 20:52:26 pierred Exp $
  + * $Revision: 1.11 $
  + * $Date: 2000/11/06 20:52:26 $
    *
    * ====================================================================
    *
  @@ -738,7 +738,7 @@
            TagLibraryInfo tl = null;
   
            String[] location = 
  -             TagLibrariesGlobal.getLocation(uri);
  +             ctxt.getTldLocation(uri);
            if (location == null) {
                tl = new TagLibraryInfoImpl(ctxt, prefix, uri);
            } else {
  
  
  
  1.13      +12 -10    
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
  
  Index: TagLibraryInfoImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TagLibraryInfoImpl.java   2000/11/02 01:08:41     1.12
  +++ TagLibraryInfoImpl.java   2000/11/06 20:52:28     1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
 1.12 2000/11/02 01:08:41 pierred Exp $
  - * $Revision: 1.12 $
  - * $Date: 2000/11/02 01:08:41 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
 1.13 2000/11/06 20:52:28 pierred Exp $
  + * $Revision: 1.13 $
  + * $Date: 2000/11/06 20:52:28 $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -180,16 +180,18 @@
           URL url = null;
           boolean relativeURL = false;
   
  +     //p("prefix: " + prefix + "  uriIn: " + uriIn);
  +     //if (location != null) p("location: " + location[0]);
        if (location == null) {
            // The URI points to the TLD itself or to a jar
            // file where the TLD is located
  -         int uriType = TagLibrariesGlobal.uriType(uri);
  -         if (uriType == TagLibrariesGlobal.ABS_URI) {
  +         int uriType = TldLocationsCache.uriType(uri);
  +         if (uriType == TldLocationsCache.ABS_URI) {
                throw new JasperException(
                       
Constants.getString("jsp.error.taglibDirective.absUriCannotBeResolved",
                                        new Object[] {uri}));
            } else if (uriType == 
  -                    TagLibrariesGlobal.NOROOT_REL_URI) {
  +                    TldLocationsCache.NOROOT_REL_URI) {
                uri = ctxt.resolveRelativeUri(uri);
            }
            location = new String[2];
  @@ -213,23 +215,23 @@
            parseTLD(location[0], in);
        } else {
            // Location points to a jar file
  -         p("JAR FILE: " + location[0]);
  +         // p("JAR FILE: " + location[0]);
            // tag library in jar file
            JarFile jarFile = null;
            ZipEntry jarEntry = null;
            InputStream stream = null;
            try {
                url = ctxt.getResource(location[0]);
  -             p("url = " + url);
  +             // p("url = " + url);
                if (url == null) return;
                url = new URL("jar:" + url.toString() + "!/");
                JarURLConnection conn =
                    (JarURLConnection) url.openConnection();
                conn.connect(); //@@@ necessary???
                jarFile = conn.getJarFile();
  -             p("jarFile: " + jarFile);
  +             // p("jarFile: " + jarFile);
                jarEntry = jarFile.getEntry(location[1]);
  -             p("jarEntry name: " + jarEntry.getName());
  +             // p("jarEntry name: " + jarEntry.getName());
                stream = jarFile.getInputStream(jarEntry);
                parseTLD(location[0], stream);
                // FIXME @@@
  
  
  
  1.7       +1 -4      
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/JspServlet.java
  
  Index: JspServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/JspServlet.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JspServlet.java   2000/10/31 22:54:16     1.6
  +++ JspServlet.java   2000/11/06 20:52:30     1.7
  @@ -83,7 +83,7 @@
   import org.apache.jasper.runtime.*;
   
   import org.apache.jasper.compiler.Compiler;
  -import org.apache.jasper.compiler.TagLibrariesGlobal;
  +import org.apache.jasper.compiler.TldLocationsCache;
   
   import org.apache.jasper.logging.Logger;
   import org.apache.jasper.logging.JasperLogger;
  @@ -286,9 +286,6 @@
            Object pd=context.getAttribute("org.apache.tomcat.protection_domain");
            loader.setProtectionDomain( pd );
        }
  -
  -     // Setup the Tag Libraries mappings
  -     TagLibrariesGlobal.init(context);
   
        if (firstTime) {
            firstTime = false;
  
  
  

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

Reply via email to