You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@locus.apache.org on 2000/01/13 19:20:36 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service/http HttpConnectionHandler.java

costin      00/01/13 10:20:35

  Modified:    src/share/org/apache/tomcat/context
                        DefaultContextSetter.java
                        LoadOnStartupInterceptor.java WarInterceptor.java
                        WebXmlInterceptor.java WorkDirInterceptor.java
               src/share/org/apache/tomcat/core ContextManager.java
                        Request.java Response.java ServletWrapper.java
               src/share/org/apache/tomcat/service
                        Ajp11ConnectionHandler.java
                        Ajp22ConnectionHandler.java
               src/share/org/apache/tomcat/service/connector
                        Ajp12ConnectionHandler.java
                        Ajp23ConnectionHandler.java ConnectorResponse.java
                        DoorConnectionHandler.java
               src/share/org/apache/tomcat/service/http
                        HttpConnectionHandler.java
  Added:       src/share/org/apache/tomcat/core ContextInterceptor.java
                        RequestImpl.java ResponseImpl.java
               src/share/org/apache/tomcat/request
                        ContextMapperInterceptor.java
  Removed:     src/share/org/apache/tomcat/request ContextInterceptor.java
  Log:
  Request and Response are now interfaces.
  
  Note that it is an "evolution" - i.e. the methods in the current interfaces
  are based on what it is used in the current tomcat, not in what it should
  be.
  
  Please start reviewing the interfaces, and add documentation to the methods
  that are right and remove the methods that are wrong ( fixing tomcat to use
  the good methods ).
  
  Also, added ContextInterceptor that will handle context initialization and
  destruction.
  
  Revision  Changes    Path
  1.4       +5 -3      jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultContextSetter.java
  
  Index: DefaultContextSetter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultContextSetter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultContextSetter.java	2000/01/11 20:43:02	1.3
  +++ DefaultContextSetter.java	2000/01/13 18:20:31	1.4
  @@ -75,7 +75,7 @@
    *
    * @author costin@dnt.ro
    */
  -public class DefaultContextSetter {
  +public class DefaultContextSetter implements ContextInterceptor {
   
       public DefaultContextSetter() {
       }
  @@ -98,10 +98,12 @@
   	// also have too change - there is no advantage in keeping them in Constants,
   	ctx.addClassPath("WEB-INF/classes");
   	ctx.addLibPath("WEB-INF/lib");
  -	return 0;
  +	return OK;
       }
   
  -	
  +    public int handleContextShutdown(Context ctx) {
  +	return OK;
  +    }
       // -------------------- implementation
       /** Encoded ContextManager.getWorkDir() + host + port + path
        */
  
  
  
  1.2       +8 -2      jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnStartupInterceptor.java
  
  Index: LoadOnStartupInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnStartupInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LoadOnStartupInterceptor.java	2000/01/09 02:57:40	1.1
  +++ LoadOnStartupInterceptor.java	2000/01/13 18:20:31	1.2
  @@ -75,7 +75,7 @@
    *
    * @author costin@dnt.ro
    */
  -public class LoadOnStartupInterceptor {
  +public class LoadOnStartupInterceptor implements ContextInterceptor {
       private static StringManager sm =StringManager.getManager("org.apache.tomcat.context");
       
       public LoadOnStartupInterceptor() {
  @@ -133,6 +133,12 @@
   		}
   	    }
   	}
  -	return 0;
  +	return OK;
       }
  +
  +    public int handleContextShutdown(Context ctx) {
  +	return OK;
  +    }
  +
  +
   }
  
  
  
  1.3       +5 -1      jakarta-tomcat/src/share/org/apache/tomcat/context/WarInterceptor.java
  
  Index: WarInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/WarInterceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WarInterceptor.java	2000/01/11 03:02:13	1.2
  +++ WarInterceptor.java	2000/01/13 18:20:31	1.3
  @@ -75,7 +75,7 @@
    *
    * @author costin@dnt.ro
    */
  -public class WarInterceptor {
  +public class WarInterceptor implements ContextInterceptor {
   
       public WarInterceptor() {
       }
  @@ -109,5 +109,9 @@
   	    }
   	}
   	return 0;
  +    }
  +
  +    public int handleContextShutdown(Context ctx) {
  +	return OK;
       }
   }
  
  
  
  1.4       +4 -1      jakarta-tomcat/src/share/org/apache/tomcat/context/WebXmlInterceptor.java
  
  Index: WebXmlInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/WebXmlInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebXmlInterceptor.java	2000/01/11 02:06:53	1.3
  +++ WebXmlInterceptor.java	2000/01/13 18:20:31	1.4
  @@ -75,7 +75,7 @@
    *
    * @author costin@dnt.ro
    */
  -public class WebXmlInterceptor {
  +public class WebXmlInterceptor implements ContextInterceptor {
       private static StringManager sm =StringManager.getManager("org.apache.tomcat.core");
       
       public WebXmlInterceptor() {
  @@ -129,6 +129,9 @@
   	return 0;
       }
   
  +    public int handleContextShutdown(Context ctx) {
  +	return OK;
  +    }
   
       private void processWebApp(Context ctx, InputStream is, boolean internal) {
           if (is != null) {
  
  
  
  1.2       +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/context/WorkDirInterceptor.java
  
  Index: WorkDirInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/WorkDirInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WorkDirInterceptor.java	2000/01/08 22:55:44	1.1
  +++ WorkDirInterceptor.java	2000/01/13 18:20:31	1.2
  @@ -75,7 +75,7 @@
    *
    * @author costin@dnt.ro
    */
  -public class WorkDirInterceptor {
  +public class WorkDirInterceptor implements ContextInterceptor {
   
       public WorkDirInterceptor() {
       }
  
  
  
  1.16      +6 -4      jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ContextManager.java	2000/01/12 19:54:01	1.15
  +++ ContextManager.java	2000/01/13 18:20:32	1.16
  @@ -86,7 +86,7 @@
        */
       private StringManager sm =StringManager.getManager("org.apache.tomcat.core");
   
  -    ContextInterceptor contextInterceptor=new ContextInterceptor( this );
  +    ContextMapperInterceptor contextInterceptor=new ContextMapperInterceptor( this );
       SessionInterceptor sessionInterceptor=new SessionInterceptor();
       MapperInterceptor mapperInterceptor=new MapperInterceptor();
       
  @@ -340,13 +340,15 @@
   		queryString =urlPath.substring(i + 1, urlPath.length());
   	    urlPath = urlPath.substring(0, i);
   	}
  -	
  -	Request lr = new Request();
  +
  +	/** Creates an "internal" request
  +	 */
  +	RequestImpl lr = new RequestImpl();
   	RequestAdapterImpl reqA=new RequestAdapterImpl();
   	lr.setRequestAdapter( reqA);
   	lr.setLookupPath( urlPath );
   	lr.setQueryString( queryString );
  -	lr.processQueryString();
  +	//	lr.processQueryString();
   
   	lr.setContext( ctx );
   	
  
  
  
  1.21      +145 -618  jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Request.java	2000/01/13 06:35:00	1.20
  +++ Request.java	2000/01/13 18:20:32	1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v 1.20 2000/01/13 06:35:00 costin Exp $
  - * $Revision: 1.20 $
  - * $Date: 2000/01/13 06:35:00 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v 1.21 2000/01/13 18:20:32 costin Exp $
  + * $Revision: 1.21 $
  + * $Date: 2000/01/13 18:20:32 $
    *
    * ====================================================================
    *
  @@ -75,643 +75,170 @@
   
   /**
    *
  - * @author James Duncan Davidson [duncan@eng.sun.com]
  - * @author James Todd [gonzo@eng.sun.com]
  - * @author Jason Hunter [jch@eng.sun.com]
  - * @author Harish Prabandham
  - * @author Alex Cruikshank [alex@epitonic.com]
    */
  -public class Request  {
  -    // XXX used by forward to override, need a better
  -    // mechanism
  -    protected String requestURI;
  -    protected String queryString;
  -
  -   //  RequestAdapterImpl Hints
  -    String serverName;
  -    protected Vector cookies = new Vector();
  -
  -    protected String contextPath;
  -    protected String lookupPath; // everything after contextPath before ?
  -    protected String servletPath;
  -    protected String pathInfo;
  -
  -    protected Hashtable parameters = new Hashtable();
  -    protected int contentLength = -1;
  -    protected String contentType = null;
  -    protected String charEncoding = null;
  -    protected String authType;
  -    protected String remoteUser;
  -
  -    // Request
  -    protected RequestAdapter reqA;
  -    protected Response response;
  -    protected HttpServletRequestFacade requestFacade;
  -    protected Context context;
  -    protected Hashtable attributes = new Hashtable();
  -
  -    protected boolean didReadFormData;
  -    protected boolean didParameters;
  -    protected boolean didCookies;
  -    // end "Request" variables
  -
  -    // Session
  -    // set by interceptors - the session id
  -    protected String reqSessionId;
  -    boolean sessionIdFromCookie=true;
  -    boolean sessionIdFromURL=false;
  -    // cache- avoid calling SessionManager for each getSession()
  -    protected HttpSession serverSession;
  -
  -
  -    // LookupResult - used by sub-requests and
  -    // set by interceptors
  -    ServletWrapper handler = null;
  -    String mappedPath = null;
  -    String resolvedServlet = null;
  -    String resouceName=null;
  -
  -    protected StringManager sm =
  -        StringManager.getManager(Constants.Package);
  -
  -    public Request() {
  -    }
  -
  -    public void setRequestAdapter( RequestAdapter reqA) {
  -	this.reqA=reqA;
  -    }
  -
  -    // Begin Adapter
  -    public String getScheme() {
  -        return reqA.getScheme();
  -    }
  -
  -    public String getMethod() {
  -        return reqA.getMethod();
  -    }
  -
  -    public String getRequestURI() {
  -        if( requestURI!=null) return requestURI;
  -	return reqA.getRequestURI();
  -    }
  -
  -    // XXX used by forward
  -    public String getQueryString() {
  -	if( queryString != null ) return queryString;
  -        return reqA.getQueryString();
  -    }
  -
  -    public String getProtocol() {
  -        return reqA.getProtocol();
  -    }
  -
  -    public String getHeader(String name) {
  -        return reqA.getHeader(name);
  -    }
  -
  -    public Enumeration getHeaderNames() {
  -        return reqA.getHeaderNames();
  -    }
  -
  -    public ServletInputStream getInputStream()
  -	throws IOException {
  -	return reqA.getInputStream();
  -    }
  -
  -    // XXX server IP and/or Host:
  -    public String getServerName() {
  -	if(serverName!=null) return serverName;
  -	serverName=reqA.getServerName();
  -	if(serverName!=null) return serverName;
  -
  -	String hostHeader = this.getHeader("host");
  -	if (hostHeader != null) {
  -	    int i = hostHeader.indexOf(':');
  -	    if (i > -1) {
  -		hostHeader = hostHeader.substring(0,i);
  -	    }
  -	    serverName=hostHeader;
  -	    return serverName;
  -	}
  -	// default to localhost - and warn
  -	System.out.println("No server name, defaulting to localhost");
  -	serverName="localhost";
  -	return serverName;
  -    }
  -
  -    public int getServerPort() {
  -        return reqA.getServerPort();
  -    }
  -
  -    public String getRemoteAddr() {
  -        return reqA.getRemoteAddr();
  -    }
  -
  -    public String getRemoteHost() {
  -	return reqA.getRemoteHost();
  -    }
  -
  -    // End Adapter "required" fields
  -
  -    public String getLookupPath() {
  -	return lookupPath;
  -    }
  -
  -    public void setLookupPath( String l ) {
  -	lookupPath=l;
  -    }
  -
  -    public String[] getParameterValues(String name) {
  -	handleParameters();
  -        return (String[])parameters.get(name);
  -    }
  -
  -    public Enumeration getParameterNames() {
  -	handleParameters();
  -        return parameters.keys();
  -    }
  -
  -    /**
  -     * Used by the RequestDispatcherImpl to get a copy of the
  -     * original parameters before adding parameters from the
  -     * query string, if any.
  -     */
  -    Hashtable getParametersCopy() {
  -	handleParameters();
  -	return (Hashtable) parameters.clone();
  -    }
  -
  -    public String getAuthType() {
  -    	return authType;
  -    }
  -
  -    public String getCharacterEncoding() {
  -        if(charEncoding!=null) return charEncoding;
  -
  -	charEncoding=reqA.getCharacterEncoding();
  -	if(charEncoding!=null) return charEncoding;
  -        charEncoding = RequestUtil.getCharsetFromContentType( getContentType());
  -	return charEncoding;
  -    }
  -
  -    public int getContentLength() {
  -        if( contentLength > -1 ) return contentLength;
  -	contentLength = reqA.getContentLength();
  -	if( contentLength > -1 ) return contentLength;
  -	contentLength = getIntHeader("content-length");
  -	return contentLength;
  -    }
  -
  -    public String getContentType() {
  -	if(contentType != null) return contentType;
  -	contentType= reqA.getContentType();
  -	if(contentType != null) return contentType;
  -	contentType = getHeader("content-type");
  -	if(contentType != null) return contentType;
  -	// can be null!! -
  -	return contentType;
  -    }
  -    
  -    String getPathTranslated() {
  -	try {
  -	    URL url = context.getResourceURL(this);
  -	    
  -	    if (url != null &&	url.getProtocol().equals("file")) {
  -		return FileUtil.patch(url.getFile());
  -	    }
  -	} catch (MalformedURLException e) {
  -	}
  -	return null;
  -    }
  -
  -
  -    public String getPathInfo() {
  -        return pathInfo;
  -    }
  -
  -    String getRemoteUser() {
  -	// Using the Servlet 2.2 semantics ...
  -	//  return request.getRemoteUser();
  -	java.security.Principal p = getUserPrincipal();
  -
  -	if (p != null) {
  -	    return p.getName();
  -	}
  -
  -	return null;
  -
  -        //return remoteUser;
  -    }
  -
  -    boolean isSecure() {
  -	if( context.getRequestSecurityProvider() == null )
  -	    return false;
  -	return context.getRequestSecurityProvider().isSecure(context, getFacade());
  -    }
  -
  -    RequestDispatcher getRequestDispatcher(String path) {
  -        if (path == null)
  -	    return null;
  -
  -	if (! path.startsWith("/")) {
  -	    path= FileUtil.catPath( getLookupPath(), path );
  -	    if( path==null) return null;
  -	}
  -
  -	return context.getRequestDispatcher(path);
  -    }
  -
  -
  -    Principal getUserPrincipal() {
  -	if( context.getRequestSecurityProvider() == null )
  -	    return null;
  -	return context.getRequestSecurityProvider().getUserPrincipal(context, getFacade());
  -    }
  -
  -    boolean isUserInRole(String role) {
  -	if( context.getRequestSecurityProvider() == null )
  -	    return false;
  -	return context.getRequestSecurityProvider().isUserInRole(context, getFacade(), role);
  -    }
  -
  -
  -    public String getRequestedSessionId() {
  -        return reqSessionId;
  -    }
  -
  -    public void setRequestedSessionId(String reqSessionId) {
  -	this.reqSessionId = reqSessionId;
  -    }
  -
  -    public String getServletPath() {
  -        return servletPath;
  -    }
  -
  -    // End hints
  -
  -    // -------------------- Request methods ( high level )
  -    public HttpServletRequestFacade getFacade() {
  -	// some requests are internal, and will never need a
  -	// facade - no need to create a new object unless needed.
  -        if( requestFacade==null )
  -	    requestFacade = new HttpServletRequestFacade(this);
  -	return requestFacade;
  -    }
  -
  -    public Context getContext() {
  -	return context;
  -    }
  -
  -    public void setResponse(Response response) {
  -	this.response = response;
  -    }
  -
  -    public Response getResponse() {
  -	return response;
  -    }
  -
  -    boolean isRequestedSessionIdFromCookie() {
  -	return sessionIdFromCookie;
  -    }
  -
  -    boolean isRequestedSessionIdFromURL() {
  -	return sessionIdFromURL;
  -    }
  +public interface Request  {
   
  -    
  -    public void setContext(Context context) {
  -	this.context = context;
  -    }
  -
  -    // Called after a Context is found, adjust all other paths.
  -    // XXX XXX XXX
  -    public void updatePaths() {
  -	contextPath = context.getPath();
  -	String requestURI = getRequestURI();
  -	// do not set it if it is already set or we have no
  -	// URI - the case of a sub-request generated internally
  -	if( requestURI!=null && lookupPath==null ) 
  -	    lookupPath = requestURI.substring(contextPath.length(),
  -					      requestURI.length());
  -
  -	// check for ? string on lookuppath
  -	int qindex = lookupPath.indexOf("?");
  -
  -	if (qindex > -1) {
  -	    lookupPath = lookupPath.substring(0, qindex);
  -	}
  -
  -	if (lookupPath.length() < 1) {
  -	    lookupPath = "/";
  -	}
  -    }
  -
  -
  -    public Cookie[] getCookies() {
  -	// XXX need to use Cookie[], Vector is not needed
  -	if( ! didCookies ) {
  -	    // XXX need a better test
  -	    // XXX need to use adapter for hings
  -	    didCookies=true;
  -	    RequestUtil.processCookies( this, cookies );
  -	}
  -
  -	Cookie[] cookieArray = new Cookie[cookies.size()];
  -
  -	for (int i = 0; i < cookies.size(); i ++) {
  -	    cookieArray[i] = (Cookie)cookies.elementAt(i);
  -	}
  -
  -	return cookieArray;
  -	//        return cookies;
  -    }
  -
  -
  -//     // XXX XXX XXX
  -//     public ServerSession getServerSession(boolean create) {
  -// 	if (context == null) {
  -// 	    System.out.println("CONTEXT WAS NEVER SET");
  -// 	    return null;
  -// 	}
  -
  -// 	if (serverSession == null && create) {
  -//             serverSession =
  -// 		ServerSessionManager.getManager()
  -// 		    .getServerSession(this, response, create);
  -//             serverSession.accessed();
  -// 	}
  -
  -// 	return serverSession;
  -//     }
  -
  -    public HttpSession getSession(boolean create) {
  -	// use the cached value 
  -	if( serverSession!=null )
  -	    return serverSession;
  +    // only if we use RA
  +    public void setRequestAdapter( RequestAdapter reqA);
   
  -	SessionManager sM=context.getSessionManager();
  -	
  -	// if the interceptors found a request id, use it
  -	if( reqSessionId != null ) {
  -	    // we have a session !
  -	    serverSession=sM.findSession( context, reqSessionId );
  -	    if( serverSession!=null) return serverSession;
  -	}
  +    // Required fields
  +
  +    public String getScheme() ;
  +
  +    public String getMethod() ;
  +
  +    public String getRequestURI() ;
  +
  +    public String getQueryString() ;
  +
  +    public String getProtocol() ;
  +
  +    public String getHeader(String name) ;
  +
  +    public Enumeration getHeaderNames() ;
  +
  +    public ServletInputStream getInputStream() 	throws IOException;
  +
  +    public String getServerName() ;
  +
  +    public int getServerPort() ;
  +        
  +    public String getRemoteAddr() ;
  +
  +    public String getRemoteHost() ;
  +
  +    // Hints - will be set by Interceptors if not set
  +    // by adapter
  +    public String getLookupPath() ;
  +    public void setLookupPath( String l ) ;
  +
  +    public String getAuthType() ;
  +
  +
  +    String getPathTranslated() ;
  +
  +    public String getPathInfo() ;
  +
  +    String getRemoteUser() ;
  +
  +	boolean isSecure() ;
   	
  -	if( ! create )
  -	    return null;
  +    Principal getUserPrincipal() ;
   
  -	// no session exists, create flag
  -	serverSession =sM.createSession( context );
  -	reqSessionId = serverSession.getId();
  -
  -	// XXX XXX will be changed - post-request Interceptors
  -	// ( to be defined) will set the session id in response,
  -	// SessionManager is just a repository and doesn't deal with
  -	// request internals.
  -	// hardcoded - will change!
  -	Cookie cookie = new Cookie(Constants.SESSION_COOKIE_NAME,
  -				   reqSessionId);
  -	cookie.setMaxAge(-1);
  -	cookie.setPath("/");
  -	cookie.setVersion(1);
  -	response.addSystemCookie(cookie);
  -
  -	return serverSession;
  -    }
  -
  -    boolean isRequestedSessionIdValid() {
  -	// so here we just assume that if we have a session it's,
  -	// all good, else not.
  -	HttpSession session = (HttpSession)getSession(false);
  -
  -	if (session != null) {
  -	    return true;
  -	} else {
  -	    return false;
  -	}
  -    }
  +    boolean isUserInRole(String role) ;
   
  -    // -------------------- LookupResult 
  -    public String getResolvedServlet() {
  -	return resolvedServlet;
  -    }
  -
  -    public void setResolvedServlet(String rs ) {
  -	resolvedServlet=rs;
  -    }
  -
  -    public ServletWrapper getWrapper() {
  -	return handler;
  -    }
  +    public String getRequestedSessionId() ;
  +
  +    public void setRequestedSessionId(String reqSessionId) ;
  +    public String getServletPath() ;
  +
  +    boolean isRequestedSessionIdFromCookie() ;
  +
  +    boolean isRequestedSessionIdFromURL() ;
  +
       
  -    public void setWrapper(ServletWrapper handler) {
  -	this.handler=handler;
  -    }
  +    public void updatePaths() ;//XXX - not to be used, use RD
  +    public void setContext(Context context) ;
   
  +
  +    public HttpSession getSession(boolean create) ;
  +
  +    boolean isRequestedSessionIdValid() ;
  +    public String getResolvedServlet() ;
  +
  +    public void setResolvedServlet(String rs ) ;
  +    public ServletWrapper getWrapper() ;
  +    
  +    public void setWrapper(ServletWrapper handler) ;
  +
       /** The file - result of mapping the request ( using aliases and other
        *  mapping rules. Usefull only for static resources.
        */
  -    public String getMappedPath() {
  -	return mappedPath;
  -    }
  -
  -    public void setMappedPath( String m ) {
  -	mappedPath=m;
  -    }
  -
  -    public String getResourceName() {
  -	return resouceName;
  -    }
  -
  -    public void setResourceName( String m ) {
  -	resouceName=m;
  -    }
  -
  -    // -------------------- Setters
  -//     public void setURI(String requestURI) {
  -//         this.requestURI = requestURI;
  -//     }
  -
  -
  -//     public void setHeaders( MimeHeaders h ) {
  -// 	headers=h;
  -//     }
  -
  -//     public void setServletInputStream( ServletInputStream in ) {
  -// 	this.in=in;
  -//     }
  -
  -//     public void setServerPort( int port ) {
  -// 	serverPort=port;
  -//     }
  -
  -//     public void setRemoteAddress(String addr) {
  -// 	this.remoteAddr = addr;
  -//     }
  -
  -//     public void setRemoteHost( String host ) {
  -// 	this.remoteHost=host;
  -//     }
  -
  -//     public void setMethod( String meth ) {
  -// 	this.method=meth;
  -//     }
  -
  -//     public void setProtocol( String protocol ) {
  -// 	this.protocol=protocol;
  -//     }
  -
  -    public void setRequestURI( String r ) {
  - 	this.requestURI=r;
  -    }
  -
  -    public void setParameters( Hashtable h ) {
  -	if(h!=null)
  -	    this.parameters=h;
  -	// XXX Should we override query parameters ??
  -    }
  -
  -    public Hashtable getParameters() {
  -	return parameters;
  -    }
  -
  -    public void setContentLength( int  len ) {
  -	this.contentLength=len;
  -    }
  -
  -    public void setContentType( String type ) {
  -	this.contentType=type;
  -    }
  -
  -    public void setCharEncoding( String enc ) {
  -	this.charEncoding=enc;
  -    }
  -
  -    public void setAuthType(String authType) {
  -        this.authType = authType;
  -    }
  -
  -
  -    public void setPathInfo(String pathInfo) {
  -	///*DEBUG*/ try {throw new Exception(); } catch(Exception ex) {ex.printStackTrace();}
  -        this.pathInfo = pathInfo;
  -    }
  +    public String getMappedPath() ;
  +
  +    public void setMappedPath( String m ) ;
  +
  +    public String getResourceName() ;
  +
  +    public void setResourceName( String m ) ;
   
  +    public void setRequestURI( String r ) ;
  +
  +
  +    public void setParameters( Hashtable h ) ;
  +
  +    public Hashtable getParameters() ;
  +    public void setContentLength( int  len ) ;
  +
  +    public void setContentType( String type ) ;
  +
  +    public void setCharEncoding( String enc ) ;
  +
  +    public void setAuthType(String authType) ;
  +
  +
  +    public void setPathInfo(String pathInfo) ;
  +
       /** Set query string - will be called by forward
        */
  -    public void setQueryString(String queryString) {
  -	this.queryString = queryString;
  -    }
  +    public void setQueryString(String queryString) ;
   
  -    /** parse the query string into parameters
  -     */
  -    public void processQueryString() {
  -        try {
  -            this.parameters = HttpUtils.parseQueryString(queryString);
  -        } catch (Throwable e) {
  -            this.parameters.clear();
  -        }
  -    }
  -
  -//     public void setScheme(String scheme) {
  -//         this.scheme = scheme;
  -//     }
  -
  -
  -    public void setSession(HttpSession serverSession) {
  -	this.serverSession = serverSession;
  -    }
  -
  -    public void setServletPath(String servletPath) {
  -	this.servletPath = servletPath;
  -    }
  -
  -
  -    // XXX
  -    // the server name should be pulled from a server object of some
  -    // sort, not just set and got.
  -
  -    /** Virtual host */
  -    public void setServerName(String serverName) {
  -	this.serverName = serverName;
  -    }
  -
  -    // -------------------- Attributes
  -    public Object getAttribute(String name) {
  -        return attributes.get(name);
  -    }
  -
  -    public void setAttribute(String name, Object value) {
  -	if(name!=null && value!=null)
  -	    attributes.put(name, value);
  -    }
  -
  -    public void removeAttribute(String name) {
  -	attributes.remove(name);
  -    }
  -
  -    public Enumeration getAttributeNames() {
  -        return attributes.keys();
  -    }
  -    // End Attributes
   
  +    
  +    // -------------------- Computed fields - will be computed if not set
  +    // ( computed at invocation time ! )
  +    public Cookie[] getCookies() ;
  +
  +    public Context getContext() ;
  +
  +    public String[] getParameterValues(String name) ;
  +
  +    public Enumeration getParameterNames() ;
  +
  +    Hashtable getParametersCopy() ;
  +
  +    public String getCharacterEncoding() ;
  +
  +    public int getContentLength() ;
  +
  +    public String getContentType() ;
  +    
  +    
  +    // Everything after context, before ?
  +
  +
  +    // Relationships. 
  +    public HttpServletRequestFacade getFacade() ;
  +
  +    public void setResponse(Response response) ;
  +
  +    public Response getResponse() ;
  +    public RequestDispatcher getRequestDispatcher(String path);
  +    
  +    // -------------------- LookupResult 
  +    public void setSession(HttpSession serverSession) ;
  +    public void setServletPath(String servletPath) ;
  +
  +    public void setServerName(String serverName) ;
  +
  +    public Object getAttribute(String name) ;
  +    public void setAttribute(String name, Object value) ;
  +
  +    public void removeAttribute(String name) ;
  +
  +    public Enumeration getAttributeNames() ;
  +
       // -------------------- Facade for MimeHeaders
  -    public long getDateHeader(String name) {
  -	return reqA.getMimeHeaders().getDateHeader(name);
  -    }
  -
  -    public Enumeration getHeaders(String name) {
  -	Vector v = reqA.getMimeHeaders().getHeadersVector(name);
  -	return v.elements();
  -    }
  -
  -    public int getIntHeader(String name)  {
  -        return reqA.getMimeHeaders().getIntHeader(name);
  -    }
  +    public long getDateHeader(String name) ;
  +
  +    public Enumeration getHeaders(String name) ;
   
  +    public int getIntHeader(String name)  ;
  +
       // -------------------- Utils - facade for RequestUtil
  -    public BufferedReader getReader()
  -	throws IOException {
  -	return RequestUtil.getReader( this );
  -    }
  -
  -    private void handleParameters() {
  -   	if(!didParameters) {
  -	    String qString=getQueryString();
  -	    if(qString!=null) {
  -		didParameters=true;
  -		RequestUtil.processFormData( qString, parameters );
  -	    }
  -	}
  -	if (!didReadFormData) {
  -	    didReadFormData = true;
  -	    Hashtable postParameters=RequestUtil.readFormData( this );
  -	    if(postParameters!=null)
  -		parameters = RequestUtil.mergeParameters(parameters, postParameters);
  -	}
  -    }
  +    public BufferedReader getReader() 	throws IOException;
  +
   
       // -------------------- End utils
  -    public void recycle() {
  -	response = null;
  -	context = null;
  -        attributes.clear();
  -        parameters.clear();
  -        cookies.removeAllElements();
  -	//        requestURI = null;
  -	//        queryString = null;
  -        contentLength = -1;
  -        contentType = null;
  -        charEncoding = null;
  -        authType = null;
  -        remoteUser = null;
  -        reqSessionId = null;
  -	serverSession = null;
  -	didParameters = false;
  -	didReadFormData = false;
  -	didCookies = false;
  -	if( reqA!=null) reqA.recycle();// XXX avoid double recycle
  -	//	moreRequests = false;
  -    }
  +    public void recycle() ;
   }
  
  
  
  1.10      +85 -516   jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java
  
  Index: Response.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Response.java	2000/01/11 20:43:02	1.9
  +++ Response.java	2000/01/13 18:20:33	1.10
  @@ -1,8 +1,4 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v 1.9 2000/01/11 20:43:02 costin Exp $
  - * $Revision: 1.9 $
  - * $Date: 2000/01/11 20:43:02 $
  - *
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
  @@ -70,6 +66,7 @@
   import javax.servlet.*;
   import javax.servlet.http.*;
   import org.apache.tomcat.util.*;
  +
   /**
    *
    * @author James Duncan Davidson [duncan@eng.sun.com]
  @@ -77,529 +74,101 @@
    * @author James Todd [gonzo@eng.sun.com]
    * @author Harish Prabandham
    * @author Hans Bergsten <ha...@gefionsoftware.com>
  + * @author costin@dnt.ro
    */
  -public class Response {
  -    protected StringManager sm =
  -        StringManager.getManager(Constants.Package);
  -
  -    protected Request request;
  -    protected HttpServletResponseFacade responseFacade;
  -    protected Vector userCookies = new Vector();
  -    protected Vector systemCookies = new Vector();
  -    protected String contentType = Constants.ContentType.Default;
  -    protected String contentLanguage = null;
  -    protected String characterEncoding = Constants.CharacterEncoding.Default;
  -    protected int contentLength = -1;
  -    protected int status = 200;
  -    private Locale locale = new Locale(Constants.LOCALE_DEFAULT, "");
  -
  -    protected MimeHeaders headers = new MimeHeaders();
  -    protected BufferedServletOutputStream out;
  -    protected PrintWriter writer;
  -
  -    protected boolean usingStream = false;
  -    protected boolean usingWriter = false;
  -    protected boolean started = false;
  -    protected boolean committed = false;
  -    protected boolean omitHeaders = false;
  -    protected String serverHeader = null;
  -
  -    protected ResponseAdapter resA;
  -
  -    public Response() {
  -        responseFacade = new HttpServletResponseFacade(this);
  -	out=new BufferedServletOutputStream();
  -	out.setResponse(this);
  -    }
  -
  -    public void setResponseAdapter( ResponseAdapter resA ) {
  -	this.resA=resA;
  -	out.setResponseAdapter( resA );
  -    }
  -
  -    public ResponseAdapter getResponseAdapter() {
  -	return resA;
  -    }
  -
  -    public HttpServletResponseFacade getFacade() {
  -	return responseFacade;
  -    }
  -
  -    // XXX - public so this can be called from ConnectionHandler.java
  -
  -    public void setRequest(Request request) {
  -	this.request = request;
  -    }
  -
  -    public boolean isStarted() {
  -	return started;
  -    }
  -
  -    public boolean isCommitted() {
  -	return committed;
  -    }
  -
  -    public String getServerHeader() {
  -        return serverHeader;
  -    }
  -
  -    public void setServerHeader(String serverHeader) {
  -        this.serverHeader = serverHeader;
  -    }
  -
  -    public void setOmitHeaders(boolean omitHeaders) {
  -	this.omitHeaders = omitHeaders;
  -    }
  -
  -//     public void setBufferedServeletOutputStream(
  -//         BufferedServletOutputStream out) {
  -// 	this.out=out;
  -//     }
  -
  -    public void recycle() {
  -	userCookies.removeAllElements();
  -	systemCookies.removeAllElements();
  -	contentType = Constants.ContentType.Default;
  -        locale = new Locale(Constants.LOCALE_DEFAULT, "");
  -	characterEncoding = Constants.CharacterEncoding.Default;
  -	contentLength = -1;
  -	status = 200;
  -	headers.clear();
  -	usingWriter = false;
  -	usingStream = false;
  -	writer=null;
  -	out.recycle();
  -	started = false;
  -	committed = false;
  -	omitHeaders=false;
  -    }
  -
  -    public void finish() throws IOException {
  -	try {
  -	    if (usingWriter && (writer != null)) {
  -	        writer.flush();
  -	    }
  -	    out.reallyFlush();
  -	} catch (SocketException e) {
  -	    return;  // munch
  -	}
  -    }
  -
  -    public boolean containsHeader(String name) {
  -	return headers.containsHeader(name);
  -    }
  -
  -    // XXX
  -    // mark whether or not we are being used as a stream our writer
  -
  -    public ServletOutputStream getOutputStream() {
  -	started = true;
  -
  -	if (usingWriter) {
  -	    String msg = sm.getString("serverResponse.outputStream.ise");
  -
  -	    throw new IllegalStateException(msg);
  -	}
  -
  -	usingStream = true;
  -
  -	return out;
  -    }
  -
  -    public PrintWriter getWriter() throws IOException {
  -	started = true;
  -
  -	if (usingStream) {
  -	    String msg = sm.getString("serverResponse.writer.ise");
  -
  -	    throw new IllegalStateException(msg);
  -	}
  -
  -	usingWriter = true;
  -
  -	if (writer == null) {
  -	    String encoding = getCharacterEncoding();
  -
  -            // XXX - EBCDIC issue here?
  -
  -	    if ((encoding == null) || "Default".equals(encoding) )
  -	        writer = new PrintWriter(new OutputStreamWriter(out));
  -	    else
  -		try {
  -		    writer = new PrintWriter(new OutputStreamWriter(out, encoding));
  -		} catch (java.io.UnsupportedEncodingException ex) {
  -		    // if we don't do that, the runtime exception will propagate
  -		    // and we'll try to send an error page - but surprise, we
  -		    // still can't get the Writer to send the error page...
  -		    writer = new PrintWriter( new OutputStreamWriter(out));
  -
  -		    // Deal with strange encodings - webmaster should see a message
  -		    // and install encoding classes - n new, unknown language was discovered,
  -		    // and they read our site!
  -		    System.out.println("Unsuported encoding: " + encoding );
  -		}
  -	}
  -
  -	out.setUsingWriter (usingWriter);
  -
  -	return writer;
  -    }
  -
  -    public void setDateHeader(String name, long date) {
  -	headers.putDateHeader(name, date);
  -    }
  -
  -    public void addDateHeader(String name, long date) {
  -        headers.addDateHeader(name, date);
  -    }
  -
  -    public void setHeader(String name, String value) {
  -	headers.putHeader(name, value);
  -    }
  -
  -    public void addHeader(String name, String value) {
  -        headers.addHeader(name, value);
  -    }
  -
  -    public void setIntHeader(String name, int value) {
  -	headers.putIntHeader(name, value);
  -    }
  -
  -    public void addIntHeader(String name, int value) {
  -        headers.addIntHeader(name, value);
  -    }
  -
  -    public int getBufferSize() {
  -	return out.getBufferSize();
  -    }
  -
  -    public void setBufferSize(int size) throws IllegalStateException {
  -
  -	// Force the PrintWriter to flush the data to the OutputStream.
  -	if (usingWriter == true) writer.flush();
  -
  -	if (out.isContentWritten() == true) {
  -	    String msg = sm.getString("servletOutputStreamImpl.setbuffer.ise");
  -	    throw new IllegalStateException (msg);
  -	}
  -	out.setBufferSize(size);
  -    }
  +public interface Response {
  +    public void setResponseAdapter( ResponseAdapter resA ) ;
  +
  +    public ResponseAdapter getResponseAdapter() ;
  +
  +    public HttpServletResponseFacade getFacade() ;
  +
  +    public void setRequest(Request request) ;
  +
  +    public boolean isStarted() ;
  +
  +    public boolean isCommitted() ;
  +
  +    public String getServerHeader() ;
  +
  +    public void setServerHeader(String serverHeader) ;
  +
  +    public void setOmitHeaders(boolean omitHeaders) ;
  +
  +    public void recycle() ;
  +
  +    public void finish() throws IOException ;
  +
  +    public boolean containsHeader(String name) ;
  +
  +
  +    public ServletOutputStream getOutputStream() ;
  +
  +    public PrintWriter getWriter() throws IOException ;
  +
  +    public void setDateHeader(String name, long date) ;
  +
  +    public void addDateHeader(String name, long date) ;
  +
  +    public void setHeader(String name, String value) ;
  +
  +
  +    public void addHeader(String name, String value) ;
   
  +
  +    public void setIntHeader(String name, int value) ;
  +
  +    public void addIntHeader(String name, int value) ;
  +
  +    public int getBufferSize() ;
  +
  +    public void setBufferSize(int size) throws IllegalStateException ;
  +
       /*
        * Methodname "isCommitted" already taken by Response class.
        */
  -    public boolean isBufferCommitted() {
  -	return out.isCommitted();
  -    }
  -
  -    public void reset() throws IllegalStateException {
  -	// Force the PrintWriter to flush its data to the output
  -        // stream before resetting the output stream
  -        //
  -	userCookies.removeAllElements();  // keep system (session) cookies
  -	contentType = Constants.ContentType.Default;
  -        locale = new Locale(Constants.LOCALE_DEFAULT, "");
  -	characterEncoding = Constants.CharacterEncoding.Default;
  -	contentLength = -1;
  -	status = 200;
  -
  -	if (usingWriter == true)
  -	    writer.flush();
  -
  -	// Reset the stream
  -	out.reset();
  -
  -        // Clear the cookies and such
  -
  -        // Clear the headers
  -        headers.clear();
  -    }
  -
  -    public void flushBuffer() throws IOException {
  -	if (usingWriter == true)
  -	    writer.flush();
  +    public boolean isBufferCommitted() ;
  +
  +    public void reset() throws IllegalStateException ;
   
  -	out.reallyFlush();
  -    }
  +    public void flushBuffer() throws IOException ;
   
   
       /** Set server-specific headers */
  -    protected void fixHeaders() throws IOException {
  -	//	System.out.println( "Fixing headers" );
  -	HttpDate date = new HttpDate(System.currentTimeMillis());
  -	headers.putHeader("Date", date.toString());
  -
  -	headers.putIntHeader("Status", status);
  -        headers.putHeader("Content-Type", contentType);
  -
  -	// Generated by Server!!!
  -	//headers.putDateHeader("Date",System.currentTimeMillis());
  -	if( getServerHeader()!=null)
  -	    headers.putHeader("Server",getServerHeader());
  -	if (contentLanguage != null) {
  -            headers.putHeader("Content-Language",contentLanguage);
  -        }
  -
  -	// context is null if we are in a error handler before the context is
  -	// set ( i.e. 414, wrong request )
  -	if( request.getContext() != null)
  -	    headers.putHeader("Servlet-Engine", request.getContext().getEngineHeader());
  -
  -
  -        if (contentLength != -1) {
  -            headers.putIntHeader("Content-Length", contentLength);
  -        }
  -
  -        // write cookies
  -        Enumeration cookieEnum = null;
  -        cookieEnum = systemCookies.elements();
  -        while (cookieEnum.hasMoreElements()) {
  -            Cookie c  = (Cookie)cookieEnum.nextElement();
  -            headers.addHeader( CookieTools.getCookieHeaderName(c),
  -			       CookieTools.getCookieHeaderValue(c));
  -	    if( c.getVersion() == 1 ) {
  -		// add a version 0 header too.
  -		// XXX what if the user set both headers??
  -		Cookie c0 = (Cookie)c.clone();
  -		c0.setVersion(0);
  -		headers.addHeader( CookieTools.getCookieHeaderName(c0),
  -				   CookieTools.getCookieHeaderValue(c0));
  -	    }
  -        }
  -	// XXX duplicated code, ugly
  -        cookieEnum = userCookies.elements();
  -        while (cookieEnum.hasMoreElements()) {
  -            Cookie c  = (Cookie)cookieEnum.nextElement();
  -            headers.addHeader( CookieTools.getCookieHeaderName(c),
  -			       CookieTools.getCookieHeaderValue(c));
  -	    if( c.getVersion() == 1 ) {
  -		// add a version 0 header too.
  -		// XXX what if the user set both headers??
  -		Cookie c0 = (Cookie)c.clone();
  -		c0.setVersion(0);
  -		headers.addHeader( CookieTools.getCookieHeaderName(c0),
  -				   CookieTools.getCookieHeaderValue(c0));
  -	    }
  -        }
  -	// XXX
  -        // do something with content encoding here
  -    }
  +    void fixHeaders() throws IOException ;
   
       // XXX should be abstract
  -    public void endResponse() throws IOException {
  -	resA.endResponse();
  -    }
  +    public void endResponse() throws IOException ;
   
       // XXX should be abstract
  -    public void writeHeaders() throws IOException {
  -	if(omitHeaders)
  -	    return;
  -
  -	resA.setStatus( status, sm.getString("sc."+ status ));
  -	fixHeaders();
  -	resA.addMimeHeaders( headers );
  -    }
  -
  -    public void addCookie(Cookie cookie) {
  -	userCookies.addElement(cookie);
  -    }
  -
  -    public void addSystemCookie(Cookie cookie) {
  -	systemCookies.addElement(cookie);
  -    }
  -
  -    public Locale getLocale() {
  -        return locale;
  -    }
  -
  -    public void setLocale(Locale locale) {
  -        if (locale == null) {
  -            return;  // throw an exception?
  -        }
  -
  -        // Save the locale for use by getLocale()
  -        this.locale = locale;
  -
  -        // Set the contentLanguage for header output
  -        contentLanguage = locale.getLanguage();
  -
  -        // Set the contentType for header output
  -        // Use the setContentType() method so encoding is set properly
  -        String newType = constructLocalizedContentType(contentType, locale);
  -        setContentType(newType);
  -    }
  -
  -    String constructLocalizedContentType(String type, Locale loc) {
  -        // Cut off everything after the semicolon
  -        int semi = type.indexOf(";");
  -        if (semi != -1) {
  -            type = type.substring(0, semi);
  -        }
  -
  -        // Append the appropriate charset, based on the locale
  -        String charset = LocaleToCharsetMap.getCharset(loc);
  -        if (charset != null) {
  -            type = type + "; charset=" + charset;
  -        }
  -
  -        return type;
  -    }
  -
  -    public String getCharacterEncoding() {
  -	return characterEncoding;
  -    }
  -
  -    public void setContentType(String contentType) {
  -        this.contentType = contentType;
  -	String encoding = RequestUtil.getCharsetFromContentType(contentType);
  -        if (encoding != null) {
  -	    characterEncoding = encoding;
  -        }
  -    }
  -
  -    public void setContentLength(int contentLength) {
  -	this.contentLength = contentLength;
  -    }
  -
  -    public int getStatus() {
  -        return status;
  -    }
  -
  -    public void setStatus(int status) {
  -        this.status = status;
  -    }
  -
  -    public void sendError(int sc) throws IOException {
  -	//	System.out.println("Send error " + sc );
  -	/*XXX*/ try {throw new Exception(); } catch(Exception ex) {ex.printStackTrace();}
  -	sendError(sc, "No detailed message");
  -    }
  -
  -    public void sendError(int sc, String msg) throws IOException {
  -	// 	System.out.println("Send error " + sc + " " + msg);
  -	// 	System.out.println("Original request " + request.getRequestURI());
  -	// 	System.out.println(request.getContext().getClassPath());
  -	//	/*XXX*/ try {throw new Exception(); } catch(Exception ex) {ex.printStackTrace();}
  -	this.status = sc;
  -
  -	Context context = request.getContext();
  -
  -	if (context == null) {
  -	    sendPrivateError(sc, msg);
  -
  -	    return;
  -	}
  -
  -	ServletContextFacade contextFacade = context.getFacade();
  -	String path = context.getErrorPage(String.valueOf(sc));
  -
  -	if (path != null) {
  -	    RequestDispatcher rd = contextFacade.getRequestDispatcher(path);
  -	    request.setAttribute("javax.servlet.error.status_code",
  -                String.valueOf(sc));
  -	    request.setAttribute("javax.servlet.error.message", msg);
  -
  -	    try {
  -		reset();
  -		rd.forward(request.getFacade(), this.getFacade());
  -	    } catch (IllegalStateException ise) {
  -		// too late for a forward
  -		try {
  -		    rd.include(request.getFacade(), this.getFacade());
  -		} catch (ServletException se) {
  -		    sendPrivateError(sc, msg);
  -		}
  -	    } catch (ServletException se) {
  -		sendPrivateError(sc, msg);
  -	    }
  -	} else {
  -	    sendPrivateError(sc, msg);
  -	}
  -
  -	// XXX
  -	// we only should set this if we are the head, not in an include
  -
  -	close();
  -    }
  -
  -    private void sendPrivateError(int sc, String msg) throws IOException {
  -	setContentType("text/html");
  -
  -	StringBuffer buf = new StringBuffer();
  -	buf.append("<h1>Error: " + sc + "</h1>\r\n");
  -	buf.append(msg + "\r\n");
  -
  -	// XXX
  -	// need to figure out if we are in an include better. The subclass
  -	// knows whether or not we are in an include!
  -
  -	sendBodyText(buf.toString());
  -    }
  -
  -    public void sendRedirect(String location) throws IOException {
  -	setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
  -	//mimeType = null;
  -	setContentType(Constants.ContentType.HTML);	// ISO-8859-1 default
  -
  -        location = makeAbsolute(location);
  -
  -	setHeader("Location", location);
  -
  -	StringBuffer buf = new StringBuffer();
  -	buf.append("<head><title>Document moved</title></head>\r\n");
  -	buf.append("<body><h1>Document moved</h1>\r\n");
  -	buf.append("This document has moved <a href=\"");
  -	buf.append(location);
  -	buf.append("\">here</a>.<p>\r\n");
  -	buf.append("</body>\r\n");
  -
  -	String body = buf.toString();
  -
  -	setContentLength(body.length());
  -
  -	sendBodyText(body);
  -
  -	close();
  -    }
  -
  -    private String makeAbsolute(String location) {
  -        URL url = null;
  -        try {
  -	    // Try making a URL out of the location
  -	    // Throws an exception if the location is relative
  -            url = new URL(location);
  -	}
  -	catch (MalformedURLException e) {
  -	    String requrl = HttpUtils.getRequestURL(
  -                                request.getFacade()).toString();
  -	    try {
  -	        url = new URL(new URL(requrl), location);
  -	    }
  -	    catch (MalformedURLException ignored) {
  -	        // Give up
  -	        return location;
  -	    }
  -	}
  -        return url.toString();
  -    }
  -
  -    public void sendBodyText(String s) throws IOException {
  -	try {
  -	    PrintWriter out = getWriter();
  -	    out.print(s);
  -	} catch (IllegalStateException ise) {
  -	    ServletOutputStream out = getOutputStream();
  -	    out.print(s);
  -	}
  -    }
  -
  -    private void close() throws IOException {
  -	try {
  -	    PrintWriter out = getWriter();
  -	    out.close();
  -	} catch (IllegalStateException ise) {
  -	    ServletOutputStream out = getOutputStream();
  -	    out.close();
  -	}
  -    }
  +    public void writeHeaders() throws IOException ;
  +
  +    public void addCookie(Cookie cookie) ;
  +
  +    public void addSystemCookie(Cookie cookie) ;
  +
  +    public Locale getLocale() ;
  +
  +    public void setLocale(Locale locale) ;
  +
  +    String constructLocalizedContentType(String type, Locale loc) ;
  +
  +    public String getCharacterEncoding() ;
  +
  +    public void setContentType(String contentType) ;
  +
  +    public void setContentLength(int contentLength) ;
  +
  +    public int getStatus() ;
  +
  +    public void setStatus(int status) ;
  +
  +    public void sendError(int sc) throws IOException ;
  +
  +    public void sendError(int sc, String msg) throws IOException ;
  +
  +    public void sendRedirect(String location) throws IOException ;
  +
  +
  +    public void sendBodyText(String s) throws IOException ;
   }
  
  
  
  1.11      +7 -5      jakarta-tomcat/src/share/org/apache/tomcat/core/ServletWrapper.java
  
  Index: ServletWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ServletWrapper.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ServletWrapper.java	2000/01/11 03:02:14	1.10
  +++ ServletWrapper.java	2000/01/13 18:20:33	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ServletWrapper.java,v 1.10 2000/01/11 03:02:14 costin Exp $
  - * $Revision: 1.10 $
  - * $Date: 2000/01/11 03:02:14 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ServletWrapper.java,v 1.11 2000/01/13 18:20:33 costin Exp $
  + * $Revision: 1.11 $
  + * $Date: 2000/01/13 18:20:33 $
    *
    * ====================================================================
    *
  @@ -209,11 +209,13 @@
   	    // XXX XXX XXX
   	    // core shouldn't depend on a particular connector!
   	    // need to find out what this code does!
  +
  +	    // XXX XXX find a better way !!!
   	    RequestAdapterImpl reqA=new RequestAdapterImpl();
   	    ResponseAdapterImpl resA=new ResponseAdapterImpl();
   	    
  -	    Request request = new Request();
  -            Response response = new Response();
  +	    RequestImpl request = new RequestImpl();
  +            ResponseImpl response = new ResponseImpl();
               request.recycle();
               response.recycle();
   
  
  
  
  1.1                  jakarta-tomcat/src/share/org/apache/tomcat/core/ContextInterceptor.java
  
  Index: ContextInterceptor.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextInterceptor.java,v 1.1 2000/01/13 18:20:32 costin Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/13 18:20:32 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat.core;
  import javax.servlet.Servlet;
  
  /**
   * Called to set up and destroy a context.
   * Example: expand WAR, move files in the right directories ( Apache ?),
   * read web.xml or check for a serialized form for faster init, etc.
   *
   * @author costin@dnt.ro
   */
  public interface ContextInterceptor {
      public static final int OK=0;
      
      public int handleContextInit(Context ctx);
      public int handleContextShutdown(Context ctx);
  }
  
  
  
  1.5       +410 -280  jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java
  
  
  
  
  1.5       +323 -58   jakarta-tomcat/src/share/org/apache/tomcat/core/ResponseImpl.java
  
  
  
  
  1.1                  jakarta-tomcat/src/share/org/apache/tomcat/request/ContextMapperInterceptor.java
  
  Index: ContextMapperInterceptor.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/ContextMapperInterceptor.java,v 1.1 2000/01/13 18:20:34 costin Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/13 18:20:34 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat.request;
  
  import org.apache.tomcat.core.*;
  import org.apache.tomcat.net.*;
  import org.apache.tomcat.util.*;
  import java.io.*;
  import java.net.*;
  import java.util.*;
  
  
  public class ContextMapperInterceptor implements RequestInterceptor {
      ContextManager cm;
      
      public ContextMapperInterceptor(ContextManager cm) {
  	this.cm=cm;
      }
  
      public int handleRequest( Request rrequest ) {
  	// someone else set it up, no need to worry
  	if( rrequest.getContext() != null )
  	    return OK;
  	
  	// resolve the server that we are for
  	String path = rrequest.getRequestURI();
  	
  	Context ctx= this.getContextByPath(path);
  	
  	// final fix on response & request
  	//		rresponse.setServerHeader(server.getServerHeader());
  	
  	String ctxPath = ctx.getPath();
  	String pathInfo =path.substring(ctxPath.length(),
  					    path.length());
  	rrequest.setContext(ctx);
  	rrequest.updatePaths();
  	return OK;
      }
  
  
      // XXX XXX XXX need to fix this - it is used by getContext(String path) (costin)
      
      /**
       * Gets the context that is responsible for requests for a
       * particular path.  If no specifically assigned Context can be
       * identified, returns the default Context.
       *
       * @param path The path for which a Context is requested
       */
      public Context getContextByPath(String path) {
  	String realPath = path;
  	Context ctx = null;
  
  	// XXX
  	// needs help ... this needs to be optimized out.
  
          lookup:
  	do {
  	    ctx = cm.getContext(path);
  	    if (ctx == null) {
  	        int i = path.lastIndexOf('/');
  		if (i > -1 && path.length() > 1) {
  		    path = path.substring(0, i);
  		    if (path.length() == 0) {
  		        path = "/";
  		    }
  		} else {
  		    // path too short
  		    break lookup;
  		}
  	    } else {
  	    }
  	} while (ctx == null);
  
  	// no map - root context
  	if (ctx == null) {
  	    ctx = cm.getContext( "" );
  	}
  
  	return ctx;
      }
  
      
  }
  
  
  
  1.11      +5 -5      jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp11ConnectionHandler.java
  
  Index: Ajp11ConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp11ConnectionHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Ajp11ConnectionHandler.java	2000/01/08 21:31:40	1.10
  +++ Ajp11ConnectionHandler.java	2000/01/13 18:20:34	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp11ConnectionHandler.java,v 1.10 2000/01/08 21:31:40 rubys Exp $
  - * $Revision: 1.10 $
  - * $Date: 2000/01/08 21:31:40 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp11ConnectionHandler.java,v 1.11 2000/01/13 18:20:34 costin Exp $
  + * $Revision: 1.11 $
  + * $Date: 2000/01/13 18:20:34 $
    *
    * ====================================================================
    *
  @@ -109,13 +109,13 @@
   	    Socket socket=connection.getSocket();
   	    socket.setSoLinger( true, 100);
   	    //XXX recycle
  -	    Request request=new Request();
  +	    RequestImpl request=new RequestImpl();
   	    
   	    AJPRequestAdapter reqA = new AJPRequestAdapter(socket); // todo: clean ConnectionHandler, make it abstract
   	    request.setRequestAdapter( reqA );
   	    
   	    Ajp11ResponseAdapter resA=new Ajp11ResponseAdapter();
  -	    Response response = new Response();
  +	    ResponseImpl response = new ResponseImpl();
               resA.setOutputStream(socket.getOutputStream());
   	    response.setResponseAdapter(resA );
   	    int count = 1;
  
  
  
  1.8       +6 -6      jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp22ConnectionHandler.java
  
  Index: Ajp22ConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp22ConnectionHandler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Ajp22ConnectionHandler.java	2000/01/07 19:14:16	1.7
  +++ Ajp22ConnectionHandler.java	2000/01/13 18:20:34	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp22ConnectionHandler.java,v 1.7 2000/01/07 19:14:16 costin Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/01/07 19:14:16 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp22ConnectionHandler.java,v 1.8 2000/01/13 18:20:34 costin Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/01/13 18:20:34 $
    *
    * ====================================================================
    *
  @@ -112,7 +112,7 @@
   	    msg=new MessageConnector(socket);
   	    Ajp22Response rresponse = new Ajp22Response(msg);
   	    //		rresponse.setProtocol( this );
  -	    Request rrequest = new Request();
  +	    RequestImpl rrequest = new RequestImpl();
   	    Ajp22Request reqA = new Ajp22Request(msg);
   	    rrequest.setRequestAdapter( reqA );
   	    rrequest.setResponse(rresponse);
  @@ -375,7 +375,7 @@
   }
   
   
  -class Ajp22Response extends Response implements Ajp22Constants {
  +class Ajp22Response extends ResponseImpl implements Ajp22Constants {
       MessageConnector proto;
       Ajp22ServletOS rout;
   
  @@ -393,7 +393,7 @@
   	out=rout;
       }
   
  -    protected void fixHeaders() throws IOException {
  +    public void fixHeaders() throws IOException {
   	//	System.out.println( "Fixing headers" );
   	headers.putIntHeader("Status", status);
           headers.putHeader("Content-Type", contentType);
  
  
  
  1.6       +2 -2      jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp12ConnectionHandler.java
  
  Index: Ajp12ConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp12ConnectionHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Ajp12ConnectionHandler.java	2000/01/08 21:31:40	1.5
  +++ Ajp12ConnectionHandler.java	2000/01/13 18:20:34	1.6
  @@ -108,9 +108,9 @@
   	    Socket socket=connection.getSocket();
   	    socket.setSoLinger( true, 100);
   
  -	    Request request = new Request();
  +	    RequestImpl request = new RequestImpl();
   	    AJP12RequestAdapter reqA = new AJP12RequestAdapter(socket);
  -	    Response response=new Response();
  +	    ResponseImpl response=new ResponseImpl();
   	    AJP12ResponseAdapter resA=new AJP12ResponseAdapter();
   
   	    InputStream in=socket.getInputStream();
  
  
  
  1.5       +4 -4      jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp23ConnectionHandler.java
  
  Index: Ajp23ConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp23ConnectionHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Ajp23ConnectionHandler.java	1999/11/11 23:28:06	1.4
  +++ Ajp23ConnectionHandler.java	2000/01/13 18:20:34	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp23ConnectionHandler.java,v 1.4 1999/11/11 23:28:06 costin Exp $
  - * $Revision: 1.4 $
  - * $Date: 1999/11/11 23:28:06 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp23ConnectionHandler.java,v 1.5 2000/01/13 18:20:34 costin Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/01/13 18:20:34 $
    *
    * ====================================================================
    *
  @@ -106,7 +106,7 @@
   	    socket=connection.getSocket();
   	    TcpConnector con=new TcpConnector( socket );
   	    ConnectorResponse rresponse=new ConnectorResponse(con);
  -	    Request  rrequest=new Request();
  +	    RequestImpl  rrequest=new RequestImpl();
   	    ConnectorRequest  reqA=new ConnectorRequest(con);
   	    rrequest.setRequestAdapter( reqA ); 
   
  
  
  
  1.3       +4 -4      jakarta-tomcat/src/share/org/apache/tomcat/service/connector/ConnectorResponse.java
  
  Index: ConnectorResponse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/ConnectorResponse.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectorResponse.java	1999/10/28 05:15:31	1.2
  +++ ConnectorResponse.java	2000/01/13 18:20:35	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/ConnectorResponse.java,v 1.2 1999/10/28 05:15:31 costin Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/28 05:15:31 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/ConnectorResponse.java,v 1.3 2000/01/13 18:20:35 costin Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/01/13 18:20:35 $
    *
    * ====================================================================
    *
  @@ -74,7 +74,7 @@
   import javax.servlet.http.*;
   
   
  -public class ConnectorResponse extends Response {
  +public class ConnectorResponse extends ResponseImpl {
       public static final int SEND_HEADERS=2;
       public static final int END_RESPONSE=5;
   
  
  
  
  1.3       +4 -4      jakarta-tomcat/src/share/org/apache/tomcat/service/connector/DoorConnectionHandler.java
  
  Index: DoorConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/DoorConnectionHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DoorConnectionHandler.java	1999/10/28 05:15:31	1.2
  +++ DoorConnectionHandler.java	2000/01/13 18:20:35	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/DoorConnectionHandler.java,v 1.2 1999/10/28 05:15:31 costin Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/28 05:15:31 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/DoorConnectionHandler.java,v 1.3 2000/01/13 18:20:35 costin Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/01/13 18:20:35 $
    *
    * ====================================================================
    *
  @@ -126,7 +126,7 @@
       public void call( MsgBuffer buf ) {
   	try {
   	    MsgConnector con=new DoorConnector();
  -	    Request rrequest=new Request();
  +	    RequestImpl rrequest=new RequestImpl();
   	    ConnectorResponse rresponse=new ConnectorResponse(con);
   	    ConnectorRequest  reqA=new ConnectorRequest(con);
   	    rrequest.setRequestAdapter( reqA );
  
  
  
  1.10      +5 -5      jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java
  
  Index: HttpConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HttpConnectionHandler.java	1999/12/13 21:07:23	1.9
  +++ HttpConnectionHandler.java	2000/01/13 18:20:35	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v 1.9 1999/12/13 21:07:23 costin Exp $
  - * $Revision: 1.9 $
  - * $Date: 1999/12/13 21:07:23 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v 1.10 2000/01/13 18:20:35 costin Exp $
  + * $Revision: 1.10 $
  + * $Date: 2000/01/13 18:20:35 $
    *
    * ====================================================================
    *
  @@ -108,9 +108,9 @@
   	    socket=connection.getSocket();
   	    InputStream in=socket.getInputStream();
   	    OutputStream out=socket.getOutputStream();
  -	    Request request=new Request();
  +	    RequestImpl request=new RequestImpl();
   	    HttpRequestAdapter reqA=new HttpRequestAdapter();
  -	    Response response=new Response();
  +	    ResponseImpl response=new ResponseImpl();
   	    HttpResponseAdapter resA=new HttpResponseAdapter();
   	    
   	    response.setRequest(request);