You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@locus.apache.org on 2000/04/23 03:42:40 UTC

cvs commit: jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core ApplicationContext.java StandardContext.java StandardContextValve.java StandardEngine.java StandardEngineValve.java StandardHost.java StandardHostValve.java StandardLoader.java StandardResources.java StandardServer.java StandardWrapperValve.java

craigmcc    00/04/22 18:42:39

  Modified:    proposals/catalina/src/bin catalina.bat
               proposals/catalina/src/share/org/apache/tomcat Context.java
                        Engine.java Host.java Request.java Wrapper.java
               proposals/catalina/src/share/org/apache/tomcat/connector
                        HttpRequestBase.java RequestBase.java
               proposals/catalina/src/share/org/apache/tomcat/core
                        ApplicationContext.java StandardContext.java
                        StandardContextValve.java StandardEngine.java
                        StandardEngineValve.java StandardHost.java
                        StandardHostValve.java StandardLoader.java
                        StandardResources.java StandardServer.java
                        StandardWrapperValve.java
  Log:
  Flesh out the rest of the mapping and servlet execution processing.  The
  implementations (other than the lack of any request dispatcher support)
  should now be ready to start testing, once the configuration stuff (like
  reading web.xml) is done.
  
  Revision  Changes    Path
  1.4       +1 -1      jakarta-tomcat/proposals/catalina/src/bin/catalina.bat
  
  Index: catalina.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/bin/catalina.bat,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- catalina.bat	2000/04/22 23:15:48	1.3
  +++ catalina.bat	2000/04/23 01:42:27	1.4
  @@ -82,7 +82,7 @@
   :stopServer
   rem Stopping Catalina
   echo Using classpath: %CLASSPATH%
  -java org.apache.tomcat.startup.Catalina -stop %2 %3 %4 %5 %6 %7 %8 %9 stop
  +java org.apache.tomcat.startup.Catalina %2 %3 %4 %5 %6 %7 %8 %9 stop
   goto cleanup
   
   :setupEnv
  
  
  
  1.7       +7 -6      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Context.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Context.java	2000/04/16 05:13:35	1.6
  +++ Context.java	2000/04/23 01:42:27	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Context.java,v 1.6 2000/04/16 05:13:35 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/04/16 05:13:35 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Context.java,v 1.7 2000/04/23 01:42:27 craigmcc Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/04/23 01:42:27 $
    *
    * ====================================================================
    *
  @@ -90,7 +90,7 @@
    * <p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/04/16 05:13:35 $
  + * @version $Revision: 1.7 $ $Date: 2000/04/23 01:42:27 $
    */
   
   public interface Context extends Container {
  @@ -491,9 +491,10 @@
        * specified context-relative URI, if any; otherwise return
        * <code>null</code>.
        *
  -     * @param uri Context-relative URI, which must start with a "/"
  +     * @param request Request to be processed
  +     * @param update Update request to reflect this mapping?
        */
  -    public Wrapper map(String uri);
  +    public Wrapper map(Request request, boolean update);
   
   
       /**
  
  
  
  1.2       +5 -4      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Engine.java
  
  Index: Engine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Engine.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Engine.java	2000/01/20 06:32:05	1.1
  +++ Engine.java	2000/04/23 01:42:27	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Engine.java,v 1.1 2000/01/20 06:32:05 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/01/20 06:32:05 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Engine.java,v 1.2 2000/04/23 01:42:27 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/04/23 01:42:27 $
    *
    * ====================================================================
    *
  @@ -88,7 +88,7 @@
    * throw <code>IllegalArgumentException</code>.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/01/20 06:32:05 $
  + * @version $Revision: 1.2 $ $Date: 2000/04/23 01:42:27 $
    */
   
   public interface Engine extends Container {
  @@ -103,8 +103,9 @@
        * can be identified, return <code>null</code> instead.
        *
        * @param request Request being processed
  +     * @param update Update the request to reflect this mapping?
        */
  -    public Host map(Request request);
  +    public Host map(Request request, boolean update);
   
   
   }
  
  
  
  1.2       +16 -5     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Host.java
  
  Index: Host.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Host.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Host.java	2000/01/20 06:32:05	1.1
  +++ Host.java	2000/04/23 01:42:28	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Host.java,v 1.1 2000/01/20 06:32:05 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/01/20 06:32:05 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Host.java,v 1.2 2000/04/23 01:42:28 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/04/23 01:42:28 $
    *
    * ====================================================================
    *
  @@ -66,6 +66,7 @@
   
   
   import javax.servlet.ServletContext;
  +import org.apache.tomcat.Request;
   
   
   /**
  @@ -90,7 +91,7 @@
    * an individual servlet context), depending upon the Engine implementation.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/01/20 06:32:05 $
  + * @version $Revision: 1.2 $ $Date: 2000/04/23 01:42:28 $
    */
   
   public interface Host extends Container {
  @@ -133,10 +134,20 @@
       /**
        * Return the Context that should be used to process this request,
        * based on matching the longest possible context path (or selecting
  -     * the default context.  If no such Context can be identified,
  +     * the default context).  If no such Context can be identified,
        * return <code>null</code> instead.
        *
  -     * @param uri Request URI, which must start with a '/'
  +     * @param request Request to be processed
  +     * @param update Update request to reflect this mapping?
  +     */
  +    public Context map(Request request, boolean update);
  +
  +
  +    /**
  +     * Return the Context that would be used to process the specified
  +     * host-relative request URI, if any; otherwise return <code>null</code>.
  +     *
  +     * @param uri Request URI to be mapped
        */
       public Context map(String uri);
   
  
  
  
  1.5       +20 -4     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Request.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Request.java	2000/04/14 18:55:26	1.4
  +++ Request.java	2000/04/23 01:42:28	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Request.java,v 1.4 2000/04/14 18:55:26 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/04/14 18:55:26 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Request.java,v 1.5 2000/04/23 01:42:28 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/04/23 01:42:28 $
    *
    * ====================================================================
    *
  @@ -78,7 +78,7 @@
    * produce the corresponding <code>Response</code>.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/04/14 18:55:26 $
  + * @version $Revision: 1.5 $ $Date: 2000/04/23 01:42:28 $
    */
   
   public interface Request {
  @@ -159,6 +159,22 @@
        * @param stream The new input stream
        */
       public void setStream(InputStream stream);
  +
  +
  +    /**
  +     * Return the Wrapper within which this Request is being processed.
  +     */
  +    public Wrapper getWrapper();
  +
  +
  +    /**
  +     * Set the Wrapper within which this Request is being processed.  This
  +     * must be called as soon as the appropriate Wrapper is identified, and
  +     * before the Request is ultimately passed to an application servlet.
  +     *
  +     * @param wrapper The newly associated Wrapper
  +     */
  +    public void setWrapper(Wrapper wrapper);
   
   
       // --------------------------------------------------------- Public Methods
  
  
  
  1.5       +4 -6      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Wrapper.java
  
  Index: Wrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Wrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Wrapper.java	2000/02/08 03:34:44	1.4
  +++ Wrapper.java	2000/04/23 01:42:28	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Wrapper.java,v 1.4 2000/02/08 03:34:44 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/02/08 03:34:44 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Wrapper.java,v 1.5 2000/04/23 01:42:28 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/04/23 01:42:28 $
    *
    * ====================================================================
    *
  @@ -89,7 +89,7 @@
    * <code>IllegalArgumentException</code>.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/02/08 03:34:44 $
  + * @version $Revision: 1.5 $ $Date: 2000/04/23 01:42:28 $
    */
   
   public interface Wrapper extends Container {
  @@ -174,8 +174,6 @@
        * <code>SingleThreadModel</code>, the Wrapper implementation must ensure
        * that this instance is not allocated again until it is deallocated by a
        * call to <code>deallocate()</code>.
  -     * <p>
  -     * <b>FIXME:  Provide a way to avoid waiting forever.</b>
        */
       public Servlet allocate();
   
  
  
  
  1.6       +10 -7     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpRequestBase.java
  
  Index: HttpRequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpRequestBase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HttpRequestBase.java	2000/04/22 23:15:49	1.5
  +++ HttpRequestBase.java	2000/04/23 01:42:30	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpRequestBase.java,v 1.5 2000/04/22 23:15:49 craigmcc Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/04/22 23:15:49 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpRequestBase.java,v 1.6 2000/04/23 01:42:30 craigmcc Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/04/23 01:42:30 $
    *
    * ====================================================================
    *
  @@ -92,7 +92,7 @@
    * be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.5 $ $Date: 2000/04/22 23:15:49 $
  + * @version $Revision: 1.6 $ $Date: 2000/04/23 01:42:30 $
    */
   
   public class HttpRequestBase
  @@ -112,7 +112,7 @@
       /**
        * The context path for this request.
        */
  -    protected String contextPath = null;
  +    protected String contextPath = "";
   
   
       /**
  @@ -275,7 +275,7 @@
   
   	super.recycle();
   	authType = null;
  -	contextPath = null;
  +	contextPath = "";
   	cookies.removeAllElements();
   	headers.clear();
   	method = null;
  @@ -317,7 +317,10 @@
        */
       public void setContextPath(String path) {
   
  -	this.contextPath = path;
  +	if (path == null)
  +	    this.contextPath = "";
  +	else
  +	    this.contextPath = path;
   
       }
   
  
  
  
  1.7       +36 -4     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/RequestBase.java
  
  Index: RequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/RequestBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RequestBase.java	2000/04/17 18:39:48	1.6
  +++ RequestBase.java	2000/04/23 01:42:31	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/RequestBase.java,v 1.6 2000/04/17 18:39:48 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/04/17 18:39:48 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/RequestBase.java,v 1.7 2000/04/23 01:42:31 craigmcc Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/04/23 01:42:31 $
    *
    * ====================================================================
    *
  @@ -83,6 +83,7 @@
   import org.apache.tomcat.Context;
   import org.apache.tomcat.Request;
   import org.apache.tomcat.Response;
  +import org.apache.tomcat.Wrapper;
   import org.apache.tomcat.util.RequestUtil;
   import org.apache.tomcat.util.StringManager;
   
  @@ -93,7 +94,7 @@
    * the connector-specific methods need to be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/04/17 18:39:48 $
  + * @version $Revision: 1.7 $ $Date: 2000/04/23 01:42:31 $
    */
   
   public abstract class RequestBase
  @@ -220,6 +221,12 @@
       protected ServletInputStream stream = null;
   
   
  +    /**
  +     * The Wrapper within which this Request is being processed.
  +     */
  +    protected Wrapper wrapper = null;
  +
  +
       // ------------------------------------------------------------- Properties
   
   
  @@ -337,6 +344,30 @@
       }
   
   
  +    /**
  +     * Return the Wrapper within which this Request is being processed.
  +     */
  +    public Wrapper getWrapper() {
  +
  +	return (this.wrapper);
  +
  +    }
  +
  +
  +    /**
  +     * Set the Wrapper within which this Request is being processed.  This
  +     * must be called as soon as the appropriate Wrapper is identified, and
  +     * before the Request is ultimately passed to an application servlet.
  +     *
  +     * @param wrapper The newly associated Wrapper
  +     */
  +    public void setWrapper(Wrapper wrapper) {
  +
  +	this.wrapper = wrapper;
  +
  +    }
  +
  +
       // --------------------------------------------------------- Public Methods
   
   
  @@ -391,6 +422,7 @@
   	serverName = null;
   	serverPort = -1;
   	stream = null;
  +	wrapper = null;
   
       }
   
  
  
  
  1.4       +4 -14     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/ApplicationContext.java
  
  Index: ApplicationContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/ApplicationContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ApplicationContext.java	2000/04/18 03:45:17	1.3
  +++ ApplicationContext.java	2000/04/23 01:42:32	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/ApplicationContext.java,v 1.3 2000/04/18 03:45:17 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/04/18 03:45:17 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/ApplicationContext.java,v 1.4 2000/04/23 01:42:32 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/23 01:42:32 $
    *
    * ====================================================================
    *
  @@ -88,7 +88,7 @@
    * associated with each instance of <code>StandardContext</code>.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/04/18 03:45:17 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/23 01:42:32 $
    */
   
   final class ApplicationContext
  @@ -268,11 +268,6 @@
        */
       public RequestDispatcher getNamedDispatcher(String name) {
   
  -	// Identify the Wrapper for the specified servlet, if any
  -	Wrapper wrapper = (Wrapper) context.findChild(name);
  -	if (wrapper == null)
  -	    return (null);
  -
   	// Create and return a corresponding request dispatcher
   	return (null);	// FIXME - getNamedDispatcher()
   
  @@ -325,11 +320,6 @@
        * @param path The path to the desired resource.
        */
       public RequestDispatcher getRequestDispatcher(String path) {
  -
  -	// Identify the Wrapper for the servlet to process this request
  -	Wrapper wrapper = context.map(path);
  -	if (wrapper == null)
  -	    return (null);
   
   	// Create and return a corresponding request dispatcher
   	return (null);	// FIXME - getRequestDispatcher()
  
  
  
  1.9       +92 -7     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContext.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StandardContext.java	2000/04/16 05:13:38	1.8
  +++ StandardContext.java	2000/04/23 01:42:33	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContext.java,v 1.8 2000/04/16 05:13:38 craigmcc Exp $
  - * $Revision: 1.8 $
  - * $Date: 2000/04/16 05:13:38 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContext.java,v 1.9 2000/04/23 01:42:33 craigmcc Exp $
  + * $Revision: 1.9 $
  + * $Date: 2000/04/23 01:42:33 $
    *
    * ====================================================================
    *
  @@ -71,9 +71,11 @@
   import java.util.Vector;
   import javax.servlet.ServletContext;
   import javax.servlet.ServletException;
  +import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import org.apache.tomcat.Container;
   import org.apache.tomcat.Context;
  +import org.apache.tomcat.HttpRequest;
   import org.apache.tomcat.Request;
   import org.apache.tomcat.Response;
   import org.apache.tomcat.Wrapper;
  @@ -90,7 +92,7 @@
    * requests directed to a particular servlet.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.8 $ $Date: 2000/04/16 05:13:38 $
  + * @version $Revision: 1.9 $ $Date: 2000/04/23 01:42:33 $
    */
   
   public final class StandardContext
  @@ -949,11 +951,94 @@
        * specified context-relative URI, if any; otherwise return
        * <code>null</code>.
        *
  -     * @param uri Context-relative URI, which must start with a "/"
  +     * @param request Request to be processed
  +     * @param update Update request to reflect this mapping?
        */
  -    public Wrapper map(String uri) {
  +    public Wrapper map(Request request, boolean update) {
   
  -	return (null);	// FIXME - map() via servlet mappings
  +	// Identify the context-relative URI to be mapped
  +	String contextPath =
  +	    ((HttpServletRequest) request.getRequest()).getContextPath();
  +	String requestURI =
  +	    ((HttpServletRequest) request.getRequest()).getRequestURI();
  +	String relativeURI = requestURI.substring(contextPath.length());
  +
  +	// Apply the standard request URI mapping rules from the specification
  +	Wrapper wrapper = null;
  +	String servletPath = relativeURI;
  +	String pathInfo = null;
  +	String name = null;
  +
  +	// Rule 1 -- Exact Match
  +	if (wrapper == null) {
  +	    name = (String) servletMappings.get(relativeURI);
  +	    if (name != null)
  +		wrapper = (Wrapper) findChild(name);
  +	    if (wrapper != null) {
  +		servletPath = relativeURI;
  +		pathInfo = null;
  +	    }
  +	}
  +
  +	// Rule 2 -- Prefix Match
  +	if (wrapper == null) {
  +	    servletPath = relativeURI;
  +	    while (true) {
  +		int slash = servletPath.lastIndexOf("/");
  +		if (slash < 0)
  +		    break;
  +		String pattern = servletPath.substring(0, slash) + "/*";
  +		name = (String) servletMappings.get(pattern);
  +		if (name != null)
  +		    wrapper = (Wrapper) findChild(name);
  +		if (wrapper != null) {
  +		    pathInfo = relativeURI.substring(servletPath.length());
  +		    if (pathInfo.length() == 0)
  +			pathInfo = null;
  +		    break;
  +		}
  +		servletPath = servletPath.substring(0, slash);
  +	    }
  +	}
  +
  +	// Rule 3 -- Extension Match
  +	if (wrapper == null) {
  +	    int slash = relativeURI.lastIndexOf("/");
  +	    if (slash >= 0) {
  +		String last = relativeURI.substring(slash);
  +		int period = last.lastIndexOf(".");
  +		if (period >= 0) {
  +		    String pattern = "*" + last.substring(period);
  +		    name = (String) servletMappings.get(pattern);
  +		    if (name != null)
  +			wrapper = (Wrapper) findChild(name);
  +		    if (wrapper != null) {
  +			servletPath = relativeURI;
  +			pathInfo = null;
  +		    }
  +		}
  +	    }
  +	}
  +
  +	// Rule 4 -- Default Match
  +	if (wrapper == null) {
  +	    name = (String) servletMappings.get("/");
  +	    if (name != null)
  +		wrapper = (Wrapper) findChild(name);
  +	    if (wrapper != null) {
  +		servletPath = "";
  +		pathInfo = relativeURI;
  +	    }
  +	}
  +
  +
  +	// Update the Request (if requested) and return this Wrapper
  +	if (update) {
  +	    request.setWrapper(wrapper);
  +	    ((HttpRequest) request).setServletPath(servletPath);
  +	    ((HttpRequest) request).setPathInfo(pathInfo);
  +	}
  +	return (wrapper);
   
       }
   
  
  
  
  1.4       +8 -12     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContextValve.java
  
  Index: StandardContextValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContextValve.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardContextValve.java	2000/04/11 00:27:52	1.3
  +++ StandardContextValve.java	2000/04/23 01:42:33	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContextValve.java,v 1.3 2000/04/11 00:27:52 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/04/11 00:27:52 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContextValve.java,v 1.4 2000/04/23 01:42:33 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/23 01:42:33 $
    *
    * ====================================================================
    *
  @@ -85,7 +85,7 @@
    * when processing HTTP requests.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/04/11 00:27:52 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/23 01:42:33 $
    */
   
   final class StandardContextValve
  @@ -98,7 +98,7 @@
       /**
        * The string manager for this package.
        */
  -    private StringManager sm =
  +    private static final StringManager sm =
   	StringManager.getManager(Constants.Package);
   
   
  @@ -119,17 +119,15 @@
       public void invoke(Request request, Response response)
   	throws IOException, ServletException {
   
  -	StandardContext context = (StandardContext) getContainer();
  -
  +	// Validate the request and response object types
   	if (!(request.getRequest() instanceof HttpServletRequest) ||
   	    !(response.getResponse() instanceof HttpServletResponse)) {
   	    return;	// FIXME - Not much else we can do generically
   	}
   
   	// Select the Wrapper to be used for this Request
  -	String path =
  -	    ((HttpServletRequest) request.getRequest()).getRequestURI();
  -	Wrapper wrapper = context.map(path);
  +	StandardContext context = (StandardContext) getContainer();
  +	Wrapper wrapper = context.map(request, true);
   	if (wrapper == null) {
   	    ((HttpServletResponse) response.getResponse()).sendError
   		(HttpServletResponse.SC_NOT_FOUND,
  @@ -138,8 +136,6 @@
   	}
   
   	// Ask this Wrapper to process this Request
  -	;	// XXX - Tell the request which Wrapper we are using?
  -	;	// XXX - Would seem to be necesary to calculate getServletPath
   	wrapper.invoke(request, response);
   
       }
  
  
  
  1.4       +9 -5      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardEngine.java
  
  Index: StandardEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardEngine.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardEngine.java	2000/01/29 07:46:33	1.3
  +++ StandardEngine.java	2000/04/23 01:42:33	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardEngine.java,v 1.3 2000/01/29 07:46:33 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/01/29 07:46:33 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardEngine.java,v 1.4 2000/04/23 01:42:33 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/23 01:42:33 $
    *
    * ====================================================================
    *
  @@ -81,7 +81,7 @@
    * fully qualified host name of that virtual host.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/01/29 07:46:33 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/23 01:42:33 $
    */
   
   public final class StandardEngine
  @@ -215,8 +215,9 @@
        * can be identified, return <code>null</code> instead.
        *
        * @param request Request being processed
  +     * @param update Update the request to reflect this mapping?
        */
  -    public Host map(Request request) {
  +    public Host map(Request request, boolean update) {
   
   	// Extract the requested server name
   	String server = request.getRequest().getServerName();
  @@ -229,6 +230,9 @@
   	Host host = (Host) findChild(server);
   	if ((host == null) && (unknownHost != null))
   	    host = (Host) findChild(unknownHost);
  +
  +	// Update the request if requested, and return the selected host
  +	;	// No update to the request is required
   	return (host);
   
       }
  
  
  
  1.4       +10 -10    jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardEngineValve.java
  
  Index: StandardEngineValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardEngineValve.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardEngineValve.java	2000/04/11 00:27:52	1.3
  +++ StandardEngineValve.java	2000/04/23 01:42:33	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardEngineValve.java,v 1.3 2000/04/11 00:27:52 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/04/11 00:27:52 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardEngineValve.java,v 1.4 2000/04/23 01:42:33 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/23 01:42:33 $
    *
    * ====================================================================
    *
  @@ -85,7 +85,7 @@
    * when processing HTTP requests.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/04/11 00:27:52 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/23 01:42:33 $
    */
   
   final class StandardEngineValve
  @@ -98,7 +98,7 @@
       /**
        * The string manager for this package.
        */
  -    private StringManager sm =
  +    private static final StringManager sm =
   	StringManager.getManager(Constants.Package);
   
   
  @@ -111,7 +111,7 @@
        * be found, return an appropriate HTTP error.
        *
        * @param request Request to be processed
  -     * @param response Response to be produced
  +     * @param update Update request to reflect this mapping?
        *
        * @exception IOException if an input/output error occurred
        * @exception ServletException if a servlet error occurred
  @@ -119,15 +119,15 @@
       public void invoke(Request request, Response response)
   	throws IOException, ServletException {
   
  -	StandardEngine engine = (StandardEngine) getContainer();
  -
  +	// Validate the request and response object types
   	if (!(request.getRequest() instanceof HttpServletRequest) ||
   	    !(response.getResponse() instanceof HttpServletResponse)) {
   	    return;	// FIXME - Not much else we can do generically
   	}
   
  -	// Select the host to be used for this request
  -	Host host = engine.map(request);
  +	// Select the Host to be used for this Request
  +	StandardEngine engine = (StandardEngine) getContainer();
  +	Host host = engine.map(request, true);
   	if (host == null) {
   	    ((HttpServletResponse) response.getResponse()).sendError
   		(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  
  
  
  1.5       +48 -10    jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardHost.java
  
  Index: StandardHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardHost.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StandardHost.java	2000/01/30 02:28:57	1.4
  +++ StandardHost.java	2000/04/23 01:42:34	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardHost.java,v 1.4 2000/01/30 02:28:57 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/01/30 02:28:57 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardHost.java,v 1.5 2000/04/23 01:42:34 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/04/23 01:42:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,11 @@
   import java.io.IOException;
   import javax.servlet.ServletContext;
   import javax.servlet.ServletException;
  +import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import org.apache.tomcat.Container;
   import org.apache.tomcat.Context;
  +import org.apache.tomcat.HttpRequest;
   import org.apache.tomcat.Host;
   import org.apache.tomcat.Request;
   import org.apache.tomcat.Response;
  @@ -82,7 +84,7 @@
    * requests directed to a particular web application.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/01/30 02:28:57 $
  + * @version $Revision: 1.5 $ $Date: 2000/04/23 01:42:34 $
    */
   
   public final class StandardHost
  @@ -240,21 +242,57 @@
       /**
        * Return the Context that should be used to process this request,
        * based on matching the longest possible context path (or selecting
  -     * the default context.  If no such Context can be identified,
  +     * the default context).  If no such Context can be identified,
        * return <code>null</code> instead.
        *
  -     * @param uri Request URI, which must start with a '/'
  +     * @param request Request to be processed
  +     * @param update Update request to reflect this mapping?
        */
  +    public Context map(Request request, boolean update) {
  +
  +	// Perform mapping on our request URI
  +	String uri =
  +	    ((HttpServletRequest) request.getRequest()).getRequestURI();
  +	Context context = map(uri);
  +
  +	// Update the request (if requested) and return the selected Context
  +	if (update) {
  +	    request.setContext(context);
  +	    if (context != null)
  +		((HttpRequest) request).setContextPath(context.getPath());
  +	    else
  +		((HttpRequest) request).setContextPath(null);
  +	}
  +	return (context);
  +
  +    }
  +
  +
  +    /**
  +     * Return the Context that would be used to process the specified
  +     * host-relative request URI, if any; otherwise return <code>null</code>.
  +     *
  +     * @param uri Request URI to be mapped
  +     */
       public Context map(String uri) {
   
  -	String path = uri;
  +	// Match on the longest possible context path prefix
   	Context context = null;
  -	while (path.length() > 1) {
  -	    context = (Context) findChild(path);
  +	while (true) {
  +	    context = (Context) findChild(uri);
   	    if (context != null)
   		break;
  -	    path = path.substring(0, path.lastIndexOf("/"));
  +	    int slash = uri.lastIndexOf("/");
  +	    if (slash < 0)
  +		break;
  +	    uri = uri.substring(0, slash);
   	}
  +
  +	// If no Context matches, select the default Context
  +	if (context == null)
  +	    context = (Context) findChild("");
  +
  +	// Return the mapped Context (if any)
   	return (context);
   
       }
  
  
  
  1.4       +9 -11     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardHostValve.java
  
  Index: StandardHostValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardHostValve.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardHostValve.java	2000/04/11 00:27:52	1.3
  +++ StandardHostValve.java	2000/04/23 01:42:34	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardHostValve.java,v 1.3 2000/04/11 00:27:52 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/04/11 00:27:52 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardHostValve.java,v 1.4 2000/04/23 01:42:34 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/23 01:42:34 $
    *
    * ====================================================================
    *
  @@ -85,7 +85,7 @@
    * when processing HTTP requests.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/04/11 00:27:52 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/23 01:42:34 $
    */
   
   final class StandardHostValve
  @@ -98,7 +98,7 @@
       /**
        * The string manager for this package.
        */
  -    private StringManager sm =
  +    private static final StringManager sm =
   	StringManager.getManager(Constants.Package);
   
   
  @@ -119,17 +119,15 @@
       public void invoke(Request request, Response response)
   	throws IOException, ServletException {
   
  -	StandardHost host = (StandardHost) getContainer();
  -
  +	// Validate the request and response object types
   	if (!(request.getRequest() instanceof HttpServletRequest) ||
   	    !(response.getResponse() instanceof HttpServletResponse)) {
   	    return;	// FIXME - Not much else we can do generically
   	}
   
  -	// Select the Context to be used for this request
  -	String path =
  -	    ((HttpServletRequest) request.getRequest()).getRequestURI();
  -	Context context = host.map(path);
  +	// Select the Context to be used for this Request
  +	StandardHost host = (StandardHost) getContainer();
  +	Context context = host.map(request, true);
   	if (context == null) {
   	    ((HttpServletResponse) response.getResponse()).sendError
   		(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  
  
  
  1.4       +5 -5      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardLoader.java
  
  Index: StandardLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardLoader.java	2000/04/10 20:01:37	1.3
  +++ StandardLoader.java	2000/04/23 01:42:34	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardLoader.java,v 1.3 2000/04/10 20:01:37 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/04/10 20:01:37 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardLoader.java,v 1.4 2000/04/23 01:42:34 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/23 01:42:34 $
    *
    * ====================================================================
    *
  @@ -97,7 +97,7 @@
    * is not present, the system class loader will be used instead.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/04/10 20:01:37 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/23 01:42:34 $
    */
   
   public final class StandardLoader
  @@ -143,7 +143,7 @@
       /**
        * The string manager for this package.
        */
  -    protected StringManager sm =
  +    protected static final StringManager sm =
   	StringManager.getManager(Constants.Package);
   
   
  
  
  
  1.5       +6 -5      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardResources.java
  
  Index: StandardResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardResources.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StandardResources.java	2000/04/10 20:01:37	1.4
  +++ StandardResources.java	2000/04/23 01:42:34	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardResources.java,v 1.4 2000/04/10 20:01:37 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/04/10 20:01:37 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardResources.java,v 1.5 2000/04/23 01:42:34 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/04/23 01:42:34 $
    *
    * ====================================================================
    *
  @@ -90,7 +90,7 @@
    * requests are resolved against the document base URL that is configured.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/04/10 20:01:37 $
  + * @version $Revision: 1.5 $ $Date: 2000/04/23 01:42:34 $
    */
   
   public final class StandardResources
  @@ -142,7 +142,8 @@
       /**
        * The string manager for this package.
        */
  -    private StringManager sm = StringManager.getManager(Constants.Package);
  +    private static final StringManager sm =
  +	StringManager.getManager(Constants.Package);
   
   
       /**
  
  
  
  1.4       +5 -5      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardServer.java
  
  Index: StandardServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardServer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardServer.java	2000/04/22 23:15:50	1.3
  +++ StandardServer.java	2000/04/23 01:42:35	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardServer.java,v 1.3 2000/04/22 23:15:50 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/04/22 23:15:50 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardServer.java,v 1.4 2000/04/23 01:42:35 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/23 01:42:35 $
    *
    * ====================================================================
    *
  @@ -88,7 +88,7 @@
    * (but not required) when deploying and starting Tomcat.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/04/22 23:15:50 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/23 01:42:35 $
    */
   
   public final class StandardServer
  @@ -138,7 +138,7 @@
       /**
        * The string manager for this package.
        */
  -    private static StringManager sm =
  +    private static final StringManager sm =
   	StringManager.getManager(Constants.Package);
   
   
  
  
  
  1.3       +37 -10    jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java
  
  Index: StandardWrapperValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StandardWrapperValve.java	2000/01/31 04:38:44	1.2
  +++ StandardWrapperValve.java	2000/04/23 01:42:35	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java,v 1.2 2000/01/31 04:38:44 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/01/31 04:38:44 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java,v 1.3 2000/04/23 01:42:35 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/04/23 01:42:35 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,12 @@
   
   
   import java.io.IOException;
  +import javax.servlet.Servlet;
   import javax.servlet.ServletException;
  +import javax.servlet.ServletRequest;
  +import javax.servlet.ServletResponse;
  +import javax.servlet.http.HttpServlet;
  +import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import org.apache.tomcat.Container;
   import org.apache.tomcat.Request;
  @@ -81,7 +86,7 @@
    * <code>StandardWrapper</code> container implementation.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2000/01/31 04:38:44 $
  + * @version $Revision: 1.3 $ $Date: 2000/04/23 01:42:35 $
    */
   
   final class StandardWrapperValve
  @@ -94,7 +99,7 @@
       /**
        * The string manager for this package.
        */
  -    private StringManager sm =
  +    private static final StringManager sm =
   	StringManager.getManager(Constants.Package);
   
   
  @@ -102,9 +107,8 @@
   
   
       /**
  -     * Select the appropriate child Wrapper to process this request,
  -     * based on the specified request URI.  If no matching Wrapper can
  -     * be found, return an appropriate HTTP error.
  +     * Invoke the servlet we are managing, respecting the rules regarding
  +     * servlet lifecycle and SingleThreadModel support.
        *
        * @param request Request to be processed
        * @param response Response to be produced
  @@ -115,8 +119,31 @@
       public void invoke(Request request, Response response)
   	throws IOException, ServletException {
   
  -	;	// FIXME - invoke()
  -	// FIXME - request.setWrapper()?  to find role links etc.
  +	Wrapper wrapper = (Wrapper) getContainer();
  +	ServletRequest sreq = request.getRequest();
  +	ServletResponse sres = response.getResponse();
  +	Servlet servlet = null;
  +
  +	try {
  +
  +	    servlet = wrapper.allocate();
  +
  +	    if ((servlet instanceof HttpServlet) &&
  +		(sreq instanceof HttpServletRequest) &&
  +		(sres instanceof HttpServletResponse))
  +		((HttpServlet) servlet).service((HttpServletRequest) sreq,
  +						(HttpServletResponse) sres);
  +	    else
  +		servlet.service(sreq, sres);
  +
  +	    wrapper.deallocate(servlet);
  +
  +	} catch (Throwable t) {
  +
  +	    ;	// FIXME - deal with exceptions thrown by the servlet
  +	    wrapper.deallocate(servlet);
  +
  +	}
   
       }