cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader StandardLoader.java

2001-06-02 Thread remm

remm01/06/02 00:34:28

  Modified:catalina/src/share/org/apache/catalina/loader
StandardLoader.java
  Log:
  - Should create the /WEB-INF/lib in the work dir IF not filesystem based
(and not the opposite).
  
  Revision  ChangesPath
  1.27  +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java
  
  Index: StandardLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- StandardLoader.java   2001/05/31 22:10:45 1.26
  +++ StandardLoader.java   2001/06/02 07:34:27 1.27
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java,v
 1.26 2001/05/31 22:10:45 craigmcc Exp $
  - * $Revision: 1.26 $
  - * $Date: 2001/05/31 22:10:45 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java,v
 1.27 2001/06/02 07:34:27 remm Exp $
  + * $Revision: 1.27 $
  + * $Date: 2001/06/02 07:34:27 $
*
* 
*
  @@ -116,7 +116,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.26 $ $Date: 2001/05/31 22:10:45 $
  + * @version $Revision: 1.27 $ $Date: 2001/06/02 07:34:27 $
*/
   
   public final class StandardLoader
  @@ -992,7 +992,7 @@
   String libName = /WEB-INF/lib;
   
   File destDir = new File(workDir, libName);
  -if (servletContext.getRealPath(libName) != null)
  +if (servletContext.getRealPath(libName) == null)
   destDir.mkdirs();
   
   DirContext libDir = null;
  
  
  



Tomcat 3.2.2 doesn't builds with jdk 1.1.8

2001-06-02 Thread Alexander Zagrebin

Hi

Tomcat 3.2.2 doesn't builds with jdk 1.1.8:
=
...
tomcat:
[javac] Compiling 215 source files to D:\work\build\tomcat\classes
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:116: Interface
org.apache.tomcat.util.compat.PrivilegedExceptionAction of nested class
org.apache.tomcat.util.compat.Jdk12Support. PrivilegedProxy not found.
[javac] static class PrivilegedProxy implements
PrivilegedExceptionAction
[javac] ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\facade\RequestD
ispatcherImpl.java:146: Undefined variable, class, or package name: java
[javac] java.security.AccessController.doPrivileged(
[javac] ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\facade\RequestD
ispatcherImpl.java:155: Class
org.apache.tomcat.facade.PrivilegedActionException not found in type
declaration.
[javac] } catch( PrivilegedActionException pe) {
[javac]  ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\facade\RequestD
ispatcherImpl.java:254: Undefined variable, class, or package name: java
[javac] java.security.AccessController.doPrivileged(
[javac] ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\facade\RequestD
ispatcherImpl.java:263: Class
org.apache.tomcat.facade.PrivilegedActionException not found in type
declaration.
[javac] } catch( PrivilegedActionException pe) {
[javac]  ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:77: Undefined variable or class name: URLClassLoader
[javac] return URLClassLoader.newInstance( urls, parent );
[javac]^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:89: Undefined variable or class name: AccessController
[javac] return AccessController.
[javac]^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:91: Class
org.apache.tomcat.util.compat.PrivilegedActionException not found in type
declaration.
[javac] } catch( PrivilegedActionException pe ) {
[javac]  ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:100: Method setContextClassLoader(java.lang.ClassLoader) not
found in class java.lang.Thread.
[javac] Thread.currentThread().setContextClassLoader(cl);
[javac] ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:104: Method getContextClassLoader() not found in class
java.lang.Thread.
[javac] return Thread.currentThread().getContextClassLoader();
[javac]^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:108: Class org.apache.tomcat.util.compat.URLClassLoader not
found in type declaration.
[javac] return ((URLClassLoader)cl).getURLs();
[javac]  ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:111: Class org.apache.tomcat.util.compat.URLClassLoader not
found in type declaration.
[javac] URLClassLoader scl=(URLClassLoader)cl;
[javac] ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:111: Class org.apache.tomcat.util.compat.URLClassLoader not
found in type declaration.
[javac] URLClassLoader scl=(URLClassLoader)cl;
[javac] ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:112: Class org.apache.tomcat.util.compat.URLClassLoader not
found in type declaration.
[javac] return ((URLClassLoader)cl.getParent()).getURLs();
[javac]  ^
[javac]
D:\work\jakarta-tomcat-3.2.2-src\src\share\org\apache\tomcat\util\compat\Jdk
12Support.java:112: Method getParent() not found in class
java.lang.ClassLoader.
[javac] return ((URLClassLoader)cl.getParent()).getURLs();
[javac] ^
[javac] Note: 4 files use deprecated APIs.  Recompile with
-deprecation for details.
[javac] 15 errors, 1 warning

Total time: 1 minute 14 seconds
=
Is it posible to build tomcat 3.2.2 from sources with jdk 1.1.8?
Thanks.

Alexander Zagrebin
--




cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/jndi - New directory

2001-06-02 Thread remm

remm01/06/02 11:19:09

  jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/jndi - New 
directory



cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler JspReader.java Parser.java ParserController.java

2001-06-02 Thread remm

remm01/06/02 11:44:45

  Modified:jasper/src/share/org/apache/jasper/compiler JspReader.java
Parser.java ParserController.java
  Log:
  - When testing with unpackWARs=false, I found areas in Jasper code
which still used File object, and were broken when Jasper is ran under
Windows. This patch simplifies the code a bit, and replaces the File objects
with String objects (the File object was only used to hold the filename).
  - Tested with tester and various JSP examples.
  
  Revision  ChangesPath
  1.6   +3 -7  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspReader.java
  
  Index: JspReader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspReader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JspReader.java2001/03/21 00:08:51 1.5
  +++ JspReader.java2001/06/02 18:44:45 1.6
  @@ -240,16 +240,12 @@
   }
   */
   
  -private void pushFile2(File file, String encoding, 
  +private void pushFile2(String file, String encoding, 
   InputStreamReader reader) 
throws ParseException, FileNotFoundException 
   {
// Register the file
  - String longName = (context == null)
  - ? file.getAbsolutePath()
  - : context.getRealPath(file.toString());
  -if (longName == null)
  -longName = file.toString();
  + String longName = file;
   
int fileid = registerSourceFile(longName);
   
  @@ -312,7 +308,7 @@
   }

   protected JspReader(JspCompilationContext ctx,
  - File file,
  + String file,
String encoding, InputStreamReader reader) 
throws ParseException, FileNotFoundException
   {
  
  
  
  1.11  +1 -1  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Parser.java   2001/04/27 01:32:47 1.10
  +++ Parser.java   2001/06/02 18:44:45 1.11
  @@ -129,7 +129,7 @@
   }
   
   // new constructor for JSP1.2
  -public Parser(JspCompilationContext ctxt, File file, 
  +public Parser(JspCompilationContext ctxt, String file, 
  String encoding, InputStreamReader inReader, 
  final ParseEventListener lnr) 
throws ParseException, java.io.FileNotFoundException
  
  
  
  1.15  +16 -31
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ParserController.java 2001/04/09 23:38:12 1.14
  +++ ParserController.java 2001/06/02 18:44:45 1.15
  @@ -183,22 +183,16 @@
throws FileNotFoundException, JasperException
   {
   //p(parse( + inFileName + ));
  +
   String absFileName = resolveFileName(inFileName);
  -File file = new File(absFileName);
  - String filePath = (ctxt == null) 
  - ? file.getAbsolutePath()
  - : ctxt.getRealPath(file.toString());
  -if (filePath == null) {
  -filePath = file.toString();
  -}
//p(filePath:  + filePath);
   
String encoding = topFileEncoding;
   InputStreamReader reader = null;
   try {
   // Figure out what type of JSP document we are dealing with
  -reader = getReader(file, encoding, absFileName);
  -figureOutJspDocument(file, encoding, reader);
  +reader = getReader(absFileName, encoding);
  +figureOutJspDocument(absFileName, encoding, reader);
   //p(isXml =  + isXml +hasTaglib =  + hasTaglib);
encoding = (newEncoding!=null) ? newEncoding : encoding;
if (isTopFile) {
  @@ -213,11 +207,11 @@
   
   // dispatch to the proper parser

  -reader = getReader(file, encoding, absFileName);
  +reader = getReader(absFileName, encoding);
   if (isXml) {
  -(new ParserXJspSax(filePath, reader, jspHandler)).parse();
  +(new ParserXJspSax(absFileName, reader, jspHandler)).parse();
   } else {
  -(new Parser(ctxt, file, encoding, reader, jspHandler)).parse();
  +(new Parser(ctxt, absFileName, encoding, reader, 

cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet JasperLoader.java

2001-06-02 Thread remm

remm01/06/02 13:22:19

  Modified:jasper/src/share/org/apache/jasper/servlet JasperLoader.java
  Log:
  - Experimental patch : Jasper will use the context classloader as the parent
classloader. I didn't notice any problems, so I'm committing the patch (which
will be very easy to revert if there are problems).
  - This makes the Jasper specific classpath request attribute obsolete. The code
can probably be removed once testing shows that this patch doesn't break
anything.
  
  Revision  ChangesPath
  1.4   +3 -2  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/JasperLoader.java
  
  Index: JasperLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/JasperLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JasperLoader.java 2001/02/08 13:38:24 1.3
  +++ JasperLoader.java 2001/06/02 20:22:19 1.4
  @@ -171,9 +171,10 @@
   }  
   }
   
  - // Class is in a package, delegate to parent
  + // Class is in a package, delegate to thread context class loader
if( !name.startsWith(Constants.JSP_PACKAGE_NAME) ) {
  - clazz = parent.loadClass(name);
  + clazz = Thread.currentThread().getContextClassLoader()
  +.loadClass(name);
if( resolve )
resolveClass(clazz);
return clazz;
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/jndi Handler.java

2001-06-02 Thread remm

remm01/06/02 13:23:07

  Added:   catalina/src/share/org/apache/naming/resources/jndi
Handler.java
  Log:
  - Add a stream handler which would respect the package naming conventions
used by the JDK.
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/jndi/Handler.java
  
  Index: Handler.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/jndi/Handler.java,v
 1.1 2001/06/02 20:23:07 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2001/06/02 20:23:07 $
   *
   * 
   *
   * 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 [EMAIL PROTECTED]
   *
   * 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/.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  package org.apache.naming.resources.jndi;
  
  import java.net.URL;
  import java.net.URLConnection;
  import java.net.URLStreamHandler;
  import java.io.IOException;
  import java.util.Hashtable;
  import javax.naming.NamingException;
  import javax.naming.directory.DirContext;
  
  import org.apache.naming.resources.DirContextURLStreamHandler;
  
  /**
   * Stream handler to a JNDI directory context.
   * 
   * @author a href=mailto:[EMAIL PROTECTED];Remy Maucherat/a
   * @version $Revision: 1.1 $
   */
  public class Handler 
  extends DirContextURLStreamHandler {
  
  
  // --- Constructors
  
  
  public Handler() {
  }
  
  
  }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources Constants.java DirContextURLStreamHandler.java

2001-06-02 Thread remm

remm01/06/02 13:24:27

  Modified:catalina/src/share/org/apache/naming/resources
Constants.java DirContextURLStreamHandler.java
  Log:
  - Two utility methods :
- The first one sets the package sys env valiable for stream handlers
- The second one is a check to see if the current thread is bound (either
  directly or through its context CL)
  
  Revision  ChangesPath
  1.2   +5 -2  
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/Constants.java
  
  Index: Constants.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/Constants.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Constants.java2001/01/23 03:41:28 1.1
  +++ Constants.java2001/06/02 20:24:27 1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/Constants.java,v
 1.1 2001/01/23 03:41:28 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/01/23 03:41:28 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/Constants.java,v
 1.2 2001/06/02 20:24:27 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/06/02 20:24:27 $
*
* 
*
  @@ -70,6 +70,9 @@
*/
   
   public final class Constants {
  +
  +public static final String PROTOCOL_HANDLER_VARIABLE = 
  +java.protocol.handler.pkgs;
   
   public static final String Package = org.apache.naming.resources;
   
  
  
  
  1.5   +30 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLStreamHandler.java
  
  Index: DirContextURLStreamHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLStreamHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DirContextURLStreamHandler.java   2001/05/04 00:30:01 1.4
  +++ DirContextURLStreamHandler.java   2001/06/02 20:24:27 1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLStreamHandler.java,v
 1.4 2001/05/04 00:30:01 remm Exp $
  - * $Revision: 1.4 $
  - * $Date: 2001/05/04 00:30:01 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLStreamHandler.java,v
 1.5 2001/06/02 20:24:27 remm Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/06/02 20:24:27 $
*
* 
*
  @@ -75,7 +75,7 @@
* Stream handler to a JNDI directory context.
* 
* @author a href=mailto:[EMAIL PROTECTED];Remy Maucherat/a
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
*/
   public class DirContextURLStreamHandler 
   extends URLStreamHandler {
  @@ -137,6 +137,32 @@
   
   
   // - Public Methods
  +
  +
  +/**
  + * Set the java.protocol.handler.pkgs system property.
  + */
  +public static void setProtocolHandler() {
  +String value = System.getProperty(Constants.PROTOCOL_HANDLER_VARIABLE);
  +if (value == null) {
  +value = Constants.Package;
  +System.setProperty(Constants.PROTOCOL_HANDLER_VARIABLE, value);
  +} else if (value.indexOf(Constants.Package) == -1) {
  +value += | + Constants.Package;
  +System.setProperty(Constants.PROTOCOL_HANDLER_VARIABLE, value);
  +}
  +}
  +
  +
  +/**
  + * Returns true if the thread or the context class loader of the current 
  + * thread is bound.
  + */
  +public static boolean isBound() {
  +return (clBindings.containsKey
  +(Thread.currentThread().getContextClassLoader()))
  +|| (threadBindings.containsKey(Thread.currentThread()));
  +}
   
   
   /**
  
  
  



cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade JspInterceptor.java

2001-06-02 Thread nacho

nacho   01/06/02 14:35:01

  Modified:src/facade22/org/apache/tomcat/facade JspInterceptor.java
  Log:
  Return a 404 error instead of stacktrace and a 500
  in case jsp file not present.
  
  Revision  ChangesPath
  1.24  +2 -0  
jakarta-tomcat/src/facade22/org/apache/tomcat/facade/JspInterceptor.java
  
  Index: JspInterceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/JspInterceptor.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- JspInterceptor.java   2001/05/21 05:13:10 1.23
  +++ JspInterceptor.java   2001/06/02 21:35:01 1.24
  @@ -621,6 +621,8 @@

if(debug0)log.log( Generated  +
mangler.getClassFileName() );
  +} catch ( java.io.FileNotFoundException fnfex ){
  + return 404;
} catch( Exception ex ) {
if( ctx!=null )
ctx.log(compile error: req=+req, ex);
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators ErrorHandler.java

2001-06-02 Thread nacho

nacho   01/06/02 14:40:38

  Modified:src/share/org/apache/tomcat/modules/generators
ErrorHandler.java
  Log:
  * nothing below 400 is logged, 3XX are normal status.
  * return a true html page for the body of the status messages
  
  Revision  ChangesPath
  1.12  +4 -3  
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java
  
  Index: ErrorHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ErrorHandler.java 2001/04/24 14:45:41 1.11
  +++ ErrorHandler.java 2001/06/02 21:40:38 1.12
  @@ -163,7 +163,7 @@
// error
// XXX this log was intended to debug the status code generation.
// it can be removed for all cases.
  - if( code != 302  code != 401  code!=400  ) {// tuneme
  + if( code  401 ) {// tuneme
ctx.log( Status code: + code +  request:  + req +  msg: +
 req.getAttribute(javax.servlet.error.message));
}
  @@ -724,7 +724,7 @@
buf = new StringBuffer();
req.setNote( sbNote, buf );
}
  - buf.append(headtitle).
  + buf.append(htmlheadtitle).
append(sm.getString(defaulterrorpage.documentmoved)).
append(/title/head\r\nbodyh1).
append(sm.getString(defaulterrorpage.documentmoved)).
  @@ -732,10 +732,11 @@
append(sm.getString(defaulterrorpage.thisdocumenthasmoved)).
append( a href=\).
append( HttpMessages.filter( location ) ).
  - append(\here/a.p\r\n/body\r\n);
  + append(\here/a.p\r\n/body\r\n/html);
   
res.setContentLength(buf.length());
res.getBuffer().write( buf );
  +res.getBuffer().close();
buf.setLength(0);
   
   }
  
  
  



RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators ErrorHandler.java

2001-06-02 Thread Ignacio J. Ortega

This last commit contains a fix for the Bugzilla bug #356
http://nagoya.betaversion.org/bugzilla/show_bug.cgi?id=356 too..
please review it..

Saludos ,
Ignacio J. Ortega


 -Mensaje original-
 De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Enviado el: sábado 2 de junio de 2001 23:41
 Para: [EMAIL PROTECTED]
 Asunto: cvs commit:
 jakarta-tomcat/src/share/org/apache/tomcat/modules/generators
 ErrorHandler.java
 
 
 nacho   01/06/02 14:40:38
 
   Modified:src/share/org/apache/tomcat/modules/generators
 ErrorHandler.java
   Log:
   * nothing below 400 is logged, 3XX are normal status.
   * return a true html page for the body of the status messages
   
   Revision  ChangesPath
   1.12  +4 -3  
 jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/
 ErrorHandler.java
   
   Index: ErrorHandler.java
   ===
   RCS file: 
 /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/g
 enerators/ErrorHandler.java,v
   retrieving revision 1.11
   retrieving revision 1.12
   diff -u -r1.11 -r1.12
   --- ErrorHandler.java   2001/04/24 14:45:41 1.11
   +++ ErrorHandler.java   2001/06/02 21:40:38 1.12
   @@ -163,7 +163,7 @@
   // error
   // XXX this log was intended to debug the status code 
 generation.
   // it can be removed for all cases.
   -   if( code != 302  code != 401  code!=400  ) {// tuneme
   +   if( code  401 ) {// tuneme
   ctx.log( Status code: + code +  request:  + req 
 +  msg: +
req.getAttribute(javax.servlet.error.message));
   }
   @@ -724,7 +724,7 @@
   buf = new StringBuffer();
   req.setNote( sbNote, buf );
   }
   -   buf.append(headtitle).
   +   buf.append(htmlheadtitle).
   append(sm.getString(defaulterrorpage.documentmoved)).
   append(/title/head\r\nbodyh1).
   append(sm.getString(defaulterrorpage.documentmoved)).
   @@ -732,10 +732,11 @@
   
 append(sm.getString(defaulterrorpage.thisdocumenthasmoved)).
   append( a href=\).
   append( HttpMessages.filter( location ) ).
   -   append(\here/a.p\r\n/body\r\n);
   +   append(\here/a.p\r\n/body\r\n/html);

   res.setContentLength(buf.length());
   res.getBuffer().write( buf );
   +res.getBuffer().close();
   buf.setLength(0);

}
   
   
   
 



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/buf ByteChunk.java

2001-06-02 Thread nacho

nacho   01/06/02 14:53:46

  Modified:src/share/org/apache/tomcat/util/buf ByteChunk.java
  Log:
  Latest encoding fixes left some problems in the way.
  Fixing a hack is a hazardous task..
  
  Revision  ChangesPath
  1.5   +11 -10
jakarta-tomcat/src/share/org/apache/tomcat/util/buf/ByteChunk.java
  
  Index: ByteChunk.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/buf/ByteChunk.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ByteChunk.java2001/05/27 23:16:19 1.4
  +++ ByteChunk.java2001/06/02 21:53:46 1.5
  @@ -208,12 +208,13 @@
   public int getStart() {
return start;
   }
  -
  +
   public int getOffset() {
  - return getStart();
  + return getEnd();
   }
   
   public void setOffset(int off) {
  +if (end  off ) end=off;
start=off;
   }
   
  @@ -263,7 +264,7 @@
   {
append( (byte)c);
   }
  -
  +
   public void append( byte b )
throws IOException
   {
  @@ -275,13 +276,13 @@
}
buff[end++]=b;
   }
  -
  +
   public void append( ByteChunk src )
throws IOException
   {
append( src.getBytes(), src.getOffset(), src.getLength());
   }
  -
  +
   /** Add data to the buffer
*/
   public void append( byte src[], int off, int len )
  @@ -297,7 +298,7 @@
end+=len;
return;
}
  - 
  +
// if we have limit and we're below
if( len = limit - end ) {
// makeSpace will grow the buffer to the limit,
  @@ -311,7 +312,7 @@
// buffer
   
// the buffer is already at ( or bigger than ) limit
  - 
  +
// Optimization:
// If len-avail  length ( i.e. after we fill the buffer with
// what we can, the remaining will fit in the buffer ) we'll just
  @@ -327,12 +328,12 @@
int avail=limit-end;
System.arraycopy(src, off, buff, end, avail);
end += avail;
  - 
  +
flushBuffer();
  - 
  +
System.arraycopy(src, off+avail, buff, end, len - avail);
end+= len - avail;
  - 
  +
} else {// len  buf.length + avail
// long write - flush the buffer and write the rest
// directly from source
  
  
  



cvs commit: jakarta-tomcat/src/doc tomcat-iis-howto.html

2001-06-02 Thread nacho

nacho   01/06/02 15:00:25

  Modified:src/doc  tomcat-iis-howto.html
  Log:
  Changed docs, isapi_redirector works smoothly with ajp13,
  andthis protocol  is suppoused to be the default for Tomcat 3.3,
  changed references and examples to  ajp13,
  thus ajp12 is used for explanations too.
  
  Revision  ChangesPath
  1.3   +84 -77jakarta-tomcat/src/doc/tomcat-iis-howto.html
  
  Index: tomcat-iis-howto.html
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/doc/tomcat-iis-howto.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tomcat-iis-howto.html 2001/02/09 02:28:03 1.2
  +++ tomcat-iis-howto.html 2001/06/02 22:00:25 1.3
  @@ -1,6 +1,6 @@
   html
   head
  -  !-- $Id: tomcat-iis-howto.html,v 1.2 2001/02/09 02:28:03 larryi Exp $ --
  +  !-- $Id: tomcat-iis-howto.html,v 1.3 2001/06/02 22:00:25 nacho Exp $ --
 !-- Copyright 1999-2001, Apache Software Foundation --
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 link rel=stylesheet href=style.css
  @@ -45,10 +45,10 @@
 liTomcat3.0 - Tomcat3.3/li
   /ol
   
  -pThe redirector uses bajp12/b to send requests to the Tomcat
  -containers. There is also an option to use Tomcat in process, more about the
  -in-process mode can be found in the a href=in-process-howto.htmlin process
  -howto./a/p
  +pThe redirector uses bajp13/b or bajp12/b to send requests to the Tomcat 
  +  containers. There is also an option to use Tomcat in process, more about the 
  +  in-process mode can be found in the a href=in-process-howto.htmlin process 
  +  howto./a/p
   
   h2Installation/h2
   
  @@ -148,12 +148,12 @@
   
   ptt/context/*=worker_name/tt/p
   
  -pWorkers and their name are defined in workers.properties, by default 
workers.properties
  -comes with a single pre-configured worker named quot;ajp12quot; so you can use 
it. As an
  -example, if you want to add a context named quot;shopquot;, the line that you 
should add
  -to tturiworkermap.properties/tt will be:/p
  +pWorkers and their name are defined in workers.properties, by default 
workers.properties 
  +  comes with 2 pre-configured workers named quot;bajp13/bquot; and 
quot;bajp12/bquot; 
  +  so you can use it. As an example, if you want to add a context named 
quot;shopquot;, 
  +  the line that you should add to tturiworkermap.properties/tt will be:/p
   
  -ptt/shop/*=ajp12/tt/p
  +ptt/shop/*=ajp13/tt/p
   
   pAfter saving tturiworkermap.properties/tt restart IIS and it will serve the 
new context./p
   
  @@ -195,7 +195,7 @@
   tturiworkermap.properties/tt, If the current request matches one of the 
entries in the list of
   URI-paths, the filter transfer the request to the extension./li
 liThe extension collects the request parameters and forwards them to the 
appropriate
  -worker using the ajp12 protocol./li
  +worker using the ajp1X protocol./li
 liThe extension collects the response from the worker and returns it to the 
browser./li
   /ol
   
  @@ -223,13 +223,12 @@
   This requires a change to the tturiworkermap.properties/tt. For the examples 
context it
   requires to replace the following line:/p
   
  -ptt/examples/*=ajp12/tt/p
  +ptt/examples/*=ajp13/tt/p
   
   pwith the following two lines:/p
   
  -ptt/examples/*.jsp=ajp12 br
  -/examples/servlet/*=ajp12 /tt/p
  -
  +ptt/examples/*.jsp=ajp13br
  +  /examples/servlet/*=ajp13/tt/p
   pAs you can see the second configuration is more explicit, it actually instruct 
the
   redirector to redirect only requests to resources under tt/examples/servlet//tt 
and
   resources under tt/examples/ /ttwhose name ends with tt.jsp/tt. This is
  @@ -238,10 +237,10 @@
   
   pYou can even be more explicit and provide lines such as:/p
   
  -ptt/example/servletname=ajp12/tt /p
  +ptt/example/servletname=ajp13/tt /p
   
  -pthat instructs the redirector to redirect request whose URL-Path equals
  -tt/example/servletname /ttto the worker named ajp12./p
  +pthat instructs the redirector to redirect request whose URL-Path equals 
tt/example/servletname 
  +  /ttto the worker named ajp13./p
   
   h3Protecting the WEB-INF Directory/h3
   
  @@ -263,23 +262,28 @@
   
   ol
 liAn entry that lists all the workers defined. For example:br
  -ttworker.list=ajp12, ajp12second/tt/li
  -  liEntries that define the host and port associated with these workers. For 
example:br
  -ttworker.ajp12.host=localhostbr
  +ttworker.list=ajp12, ajp13, ajp13second/tt/li
  +  liEntries that define the host and port associated with these workers. For 
  +example:br
  +ttworker.ajp12.host=farhostbr
   worker.ajp12.port=8007br
  -worker.ajp12second.host=otherhostbr
  -worker.ajp12second.port=8007/tt/li
  +worker.ajp13.host=localhostbr
  +worker.ajp13.port=8009br
  +worker.ajp13second.host=otherhostbr
  +worker.ajp13second.port=8009/tt/li
   /ol
   
  

[Patch]jk_isapi_plugin.c, Virtual Server support for IIS

2001-06-02 Thread Ignacio J. Ortega

Hola a Todos:

Attached is a patch for jk_isapi_plugin.c and a example
uriworkermap.properties file.
This patch adds some syntax sugar to uriworkermap.properties file format
to allow fine grained control over redirection of tomcat contexts to IIS
virtual hosts, allowing a syntax like :

/www.somevirtualhost.com/context/*.jsp=ajp13 

in UWM.P file.. in addition to the old one of :

/context/*.jsp=ajp13

The old syntax comprises the mapping for the entire server, that is this
context are honored in all IIS virtual servers..

Why i'm sending a patch and not committing it directly?

I'm not sure if the patch ( mostly a hack ) has the merit to go to the
repository,as it doubles the number of scans throught the map array, is
one of the most wanted TC feature a critical piece, and the patch goes
directly to his heart where performance is crucial ...i prefer to hear
from people before commit..

Saludos ,
Ignacio J. Ortega

 isapi_plugin.diff
 uriworkermap.properties


get/setAttribute and getParameter...

2001-06-02 Thread Oskar Zinger

Hi,
What is more time consuming?

JSP1:
% request.setAttribute(FLAG, new Boolean(true)); %
jsp:include page=JSP2.jsp flush=true/

JSP2:
% boolean FLAG = ((Boolean)
request.getAttribute(FLAG)).booleanValue();
 if (FLAG) {
   ..
   ...
 }
%

OR?:

JSP1:
jsp:include page=JSP2.jsp?FLAG=true flush=true/

JSP2:
% String FLAG = request.getParameter(FLAG);
  if (FLAG.equals('true)) {
 ..
 ..
  }
%

OR?:

JSP1:
jsp:include page=JSP2.jsp?FLAG=true flush=true/

JSP2:
% boolean FLAG = (new
Boolean(request.getParameter(FLAG))).booleanValue();
  if (FLAG) {
 ..
 ..
  }
%


AND, which way is it best practiced.

Thankss for any help!
--
Oskar Zinger