You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ak...@locus.apache.org on 2000/03/28 06:29:50 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/logging Logger.java

akv         00/03/27 20:29:50

  Modified:    src/share/org/apache/jasper/compiler
                        JspParseEventListener.java JspReader.java
                        TagBeginGenerator.java TagLibraryInfoImpl.java
               src/share/org/apache/jasper/resources messages.properties
               src/share/org/apache/jasper/runtime JspRuntimeLibrary.java
               src/share/org/apache/tomcat/logging Logger.java
  Log:
  Bug fixes for:
  
  96, 99, 100, 107
  
  Revision  Changes    Path
  1.12      +3 -4      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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JspParseEventListener.java	2000/02/25 19:48:16	1.11
  +++ JspParseEventListener.java	2000/03/28 04:29:47	1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v 1.11 2000/02/25 19:48:16 mandar Exp $
  - * $Revision: 1.11 $
  - * $Date: 2000/02/25 19:48:16 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v 1.12 2000/03/28 04:29:47 akv Exp $
  + * $Revision: 1.12 $
  + * $Date: 2000/03/28 04:29:47 $
    *
    * ====================================================================
    * 
  @@ -861,7 +861,6 @@
                                      start, stop);
   
   	addGenerator(gen);
  -
       }
   
       public void handleTagEnd(Mark start, Mark stop, String prefix, 
  
  
  
  1.13      +9 -0      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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JspReader.java	2000/02/27 16:46:34	1.12
  +++ JspReader.java	2000/03/28 04:29:48	1.13
  @@ -101,6 +101,8 @@
        * @return The index of the now registered file.
        */
       protected int registerSourceFile(String file) {
  +        if (sourceFiles.contains(file))
  +            return -1;
   	sourceFiles.addElement(file);
   	this.size++;
   	return sourceFiles.size()-1;
  @@ -146,6 +148,13 @@
   
   	// Register the file, and read its content:
   	int fileid    = registerSourceFile(file.getAbsolutePath());
  +        if (fileid == -1)
  +            throw new ParseException(Constants.getString("jsp.error.file.already.registered",
  +                                                         new Object[] { 
  +                                                             file 
  +                                                         }));
  +                                                         
  +                                     
   	InputStreamReader reader = null;
   	try {
               if (context == null)
  
  
  
  1.10      +12 -4     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TagBeginGenerator.java	2000/01/24 05:54:51	1.9
  +++ TagBeginGenerator.java	2000/03/28 04:29:48	1.10
  @@ -130,9 +130,13 @@
       }
       
       void validate() throws JasperException {
  +
  +        // Sigh! I wish I didn't have to clone here.
  +        Hashtable attribs = (Hashtable) attrs.clone(); 
  +
           // First make sure all required attributes are indeed present. 
           for(int i = 0; i < attributes.length; i++)
  -            if (attributes[i].isRequired() && attrs.get(attributes[i].getName()) == null)
  +            if (attributes[i].isRequired() && attribs.get(attributes[i].getName()) == null)
                   throw new JasperException(Constants.getString("jsp.error.missing_attribute",
                                                                 new Object[] {
                                                                     attributes[i].getName(),
  @@ -140,13 +144,17 @@
                                                                 }
                                                                 ));
           // Now make sure there are no invalid attributes... 
  -        Enumeration e = attrs.keys();
  +        Enumeration e = attribs.keys();
           while (e.hasMoreElements()) {
               String attr = (String) e.nextElement();
               boolean found = false;
               for(int i = 0; i < attributes.length; i++)
  -                if (attr.equals(attributes[i].getName()))
  +                if (attr.equals(attributes[i].getName())) {
                       found = true;
  +                    if (attributes[i].canBeRequestTime())
  +                        attribs.put(attr, TagData.REQUEST_TIME_VALUE);
  +                }
  +            
               if (!found)
                   throw new JasperException(Constants.getString("jsp.error.bad_attribute",
                                                                 new Object[] {
  @@ -155,7 +163,7 @@
                                                                 ));
           }
   
  -        tagData = new TagData(attrs);
  +        tagData = new TagData(attribs);
           if (!ti.isValid(tagData))
               throw new JasperException(Constants.getString("jsp.error.invalid_attributes"));
       }
  
  
  
  1.16      +4 -4      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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TagLibraryInfoImpl.java	2000/03/24 22:48:47	1.15
  +++ TagLibraryInfoImpl.java	2000/03/28 04:29:48	1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v 1.15 2000/03/24 22:48:47 akv Exp $
  - * $Revision: 1.15 $
  - * $Date: 2000/03/24 22:48:47 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v 1.16 2000/03/28 04:29:48 akv Exp $
  + * $Revision: 1.16 $
  + * $Date: 2000/03/28 04:29:48 $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -372,7 +372,7 @@
                       this.info = t.getData();
               } else if (tname.equals("tag"))
                   tagVector.addElement(createTagInfo(e));
  -            else 
  +            else
                   Constants.message("jsp.warning.unknown.element.in.TLD", 
                                     new Object[] {
                                         e.getTagName()
  
  
  
  1.15      +2 -1      jakarta-tomcat/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- messages.properties	2000/02/25 19:59:32	1.14
  +++ messages.properties	2000/03/28 04:29:49	1.15
  @@ -65,10 +65,11 @@
   jsp.error.unable.load=Unable to compile class for JSP
   jsp.error.unable.rename=Unable to rename class file {0} to {1}
   jsp.error.mandatory.attribute={0}: Mandatory attribute {1} missing
  -jsp.engine.info=JSP 1.1 Engine EA
  +jsp.engine.info=Jasper JSP 1.1 Engine
   jsp.error.invalid.attribute={0}: Invalid attribute, {1}
   jsp.error.usebean.class.notfound=Class: {0} not found
   jsp.error.file.cannot.read=Cannot read file: {0}
  +jsp.error.file.already.registered=Seen file {0} already, maybe this is a recursive include?!
   jsp.error.quotes.unterminated=Unterminated quotes
   jsp.error.attr.quoted=Attribute value should be quoted
   jsp.error.attr.novalue=Attribute {0} has no value
  
  
  
  1.4       +5 -5      jakarta-tomcat/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java
  
  Index: JspRuntimeLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JspRuntimeLibrary.java	2000/01/12 07:11:15	1.3
  +++ JspRuntimeLibrary.java	2000/03/28 04:29:49	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java,v 1.3 2000/01/12 07:11:15 shemnon Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/01/12 07:11:15 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java,v 1.4 2000/03/28 04:29:49 akv Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/03/28 04:29:49 $
    *
    * ====================================================================
    * 
  @@ -135,9 +135,9 @@
                   return new java.io.File(s);
               }
           } catch (Exception ex) {
  -	    throw new JasperException (ex);
  +            throw new JasperException (ex);
           }
  -        return null;
  +        return s;
       }
       // __end convertMethod
   
  
  
  
  1.6       +6 -2      jakarta-tomcat/src/share/org/apache/tomcat/logging/Logger.java
  
  Index: Logger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/logging/Logger.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Logger.java	2000/03/25 03:35:27	1.5
  +++ Logger.java	2000/03/28 04:29:49	1.6
  @@ -211,7 +211,10 @@
        * @param	path		The path to the log file. 
        */
       public void setPath(String path) {
  -	this.path=path;
  +        if (File.separatorChar == '/')
  +            this.path = path.replace('\\', '/');
  +        else if (File.separatorChar = '\\')
  +            this.path = path.replace('/', '\\');
       }
   
       public String getPath() {
  @@ -222,7 +225,8 @@
        *  You must open the logger before use, or it will write to System.err
        */
       public void open() {
  -	if( path==null ) return;
  +	if (path == null) 
  +            return;
   	// use default sink == System.err
   	try {
   	    File file = new File(path);