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/30 03:23:23 UTC
cvs commit: jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core StandardContextValve.java StandardWrapper.java StandardWrapperValve.java
craigmcc 00/04/29 18:23:23
Modified: proposals/catalina STATUS.html
proposals/catalina/src/conf server.xml web.xml
proposals/catalina/src/share/org/apache/tomcat/connector
HttpResponseBase.java LocalStrings.properties
ResponseBase.java ResponseStream.java
proposals/catalina/src/share/org/apache/tomcat/core
StandardContextValve.java StandardWrapper.java
StandardWrapperValve.java
Log:
Further debugging on servlet processing. Now all the servlet examples
except the session one are working. There are also problems in the HTTP
connector when you overload it with requests, but it works for low volume
activity.
Revision Changes Path
1.4 +1 -47 jakarta-tomcat/proposals/catalina/STATUS.html
Index: STATUS.html
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/STATUS.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- STATUS.html 2000/04/21 19:58:35 1.3
+++ STATUS.html 2000/04/30 01:23:19 1.4
@@ -141,19 +141,6 @@
<th width="30%">Volunteers</th>
</tr>
<tr>
- <td align="center">High</td>
- <td>In <code>StandardContext</code>, implement mapping of request URIs to
- the corresponding Wrapper containers. [org.apache.tomcat.core]</td>
- <td><a href="mailto:Craig.McClanahan@eng.sun.com">Craig McClanahan</a></td>
- </tr>
- <tr>
- <td align="center">High</td>
- <td>Finish initial implementation of <code>StandardWrapper</code> and
- <code>StandardWrapperValve</code>, including support for non-HTTP
- servlets. [org.apache.tomcat.core]</td>
- <td><a href="mailto:Craig.McClanahan@eng.sun.com">Craig McClanahan</a></td>
- </tr>
- <tr>
<td align="center">Medium</td>
<td>Design and implement support for request dispatchers that conforms
to the Servlet API Specification. [org.apache.tomcat.core]
@@ -186,13 +173,6 @@
<th width="30%">Volunteers</th>
</tr>
<tr>
- <td align="center">High</td>
- <td>Finish design and implementation of startup and shutdown support
- for Catalina, similar to that provided by Tomcat 3.x.
- [org.apache.tomcat.startup]
- <td>---</td>
- </tr>
- <tr>
<td align="center">Medium</td>
<td>Design and implement a web application providing server
management support for a running Catalina installation.
@@ -217,18 +197,6 @@
<th width="30%">Volunteers</th>
</tr>
<tr>
- <td align="center">High</td>
- <td>Design and implement a default file-serving servlet for
- Catalina. [org.apache.tomcat.servlets]</td>
- <td>---</td>
- </tr>
- <tr>
- <td align="center">High</td>
- <td>Design and implement a "servlet invoker" servlet for
- Catalina. [org.apache.tomcat.servlets]</td>
- <td>---</td>
- </tr>
- <tr>
<td align="center">Medium</td>
<td>Design and implement a servlet that supports full WebDAV
functionality. [org.apache.tomcat.webdav]</td>
@@ -304,20 +272,6 @@
<th width="30%">Volunteers</th>
</tr>
<tr>
- <td align="center">High</td>
- <td>Design and implement a standard <code>Loader</code> implementation,
- possibly wrapping AdaptiveClassLoader. [org.apache.tomcat.loader]</td>
- <td>---</td>
- </tr>
- <tr>
- <td align="center">High</td>
- <td>Design and implement a <code>Realm</code> implementation that uses an
- XML-based database of users, compatible with the Tomcat 3.x version
- that uses the <code>conf/tomcat-users.xml</code> file.
- [org.apache.tomcat.realm]</td>
- <td>---</td>
- </tr>
- <tr>
<td align="center">Medium</td>
<td>Design and implement a <code>Realm</code> implementation that accesses
authentication and role information from a JDBC-accessed database.
@@ -400,7 +354,7 @@
<br>
<div align="center"><hr width="75%"><font size="2">
-$Id: STATUS.html,v 1.3 2000/04/21 19:58:35 craigmcc Exp $
+$Id: STATUS.html,v 1.4 2000/04/30 01:23:19 craigmcc Exp $
</font></div>
</body>
1.12 +2 -2 jakarta-tomcat/proposals/catalina/src/conf/server.xml
Index: server.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/conf/server.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- server.xml 2000/04/29 23:20:31 1.11
+++ server.xml 2000/04/30 01:23:19 1.12
@@ -48,9 +48,9 @@
</Context>
<!-- Examples Context -->
- <Context path="/examples" docBase="webapps/examples" debug="2">
+ <Context path="/examples" docBase="webapps/examples" debug="0">
<Listener className="org.apache.tomcat.startup.ContextConfig"
- debug="2"/>
+ debug="0"/>
<Manager className="org.apache.tomcat.session.StandardManager"
checkInterval="15" maxActiveSessions="100"
pathname="sessions/localhost_examples.sessions"/>
1.4 +1 -1 jakarta-tomcat/proposals/catalina/src/conf/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/conf/web.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- web.xml 2000/04/29 23:20:31 1.3
+++ web.xml 2000/04/30 01:23:19 1.4
@@ -26,7 +26,7 @@
<load-on-startup>2</load-on-startup>
<init-param>
<param-name>debug</param-name>
- <param-value>99</param-value>
+ <param-value>0</param-value>
</init-param>
</servlet>
1.5 +12 -11 jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpResponseBase.java
Index: HttpResponseBase.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpResponseBase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HttpResponseBase.java 2000/04/22 23:15:49 1.4
+++ HttpResponseBase.java 2000/04/30 01:23:20 1.5
@@ -1,13 +1,13 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpResponseBase.java,v 1.4 2000/04/22 23:15:49 craigmcc Exp $
- * $Revision: 1.4 $
- * $Date: 2000/04/22 23:15:49 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpResponseBase.java,v 1.5 2000/04/30 01:23:20 craigmcc Exp $
+ * $Revision: 1.5 $
+ * $Date: 2000/04/30 01:23:20 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * 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
+ * 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"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.tomcat.connector;
@@ -93,7 +93,7 @@
* methods need to be implemented.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.4 $ $Date: 2000/04/22 23:15:49 $
+ * @version $Revision: 1.5 $ $Date: 2000/04/30 01:23:20 $
*/
public class HttpResponseBase
@@ -395,6 +395,7 @@
return (false);
if (hreq.getServerPort() != url.getPort())
return (false);
+
String contextPath = getContext().getPath();
if ((contextPath != null) && (contextPath.length() > 0)) {
String file = url.getFile();
@@ -515,7 +516,7 @@
}
}
return (url.toString());
-
+
}
1.4 +2 -2 jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/LocalStrings.properties
Index: LocalStrings.properties
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/LocalStrings.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LocalStrings.properties 2000/04/18 03:45:15 1.3
+++ LocalStrings.properties 2000/04/30 01:23:20 1.4
@@ -4,8 +4,8 @@
requestBase.getReader.ise=getInputStream() has already been called for this request
requestStream.close.closed=Cannot close the same input stream twice
requestStream.read.closed=This input stream has been closed
-response.getOutputStream.ise=getWriter() has already been called for this response
-response.getWriter.ise=getOutputStream() has already been called for this response
+responseBase.getOutputStream.ise=getWriter() has already been called for this response
+responseBase.getWriter.ise=getOutputStream() has already been called for this response
responseBase.reset.ise=Cannot reset after response has been committed
responseBase.setBufferSize.ise=Buffer size cannot be changed after data has been written
responseStream.close.closed=This output stream has already been closed
1.7 +11 -11 jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseBase.java
Index: ResponseBase.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseBase.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ResponseBase.java 2000/04/29 05:59:53 1.6
+++ ResponseBase.java 2000/04/30 01:23:20 1.7
@@ -1,13 +1,13 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseBase.java,v 1.6 2000/04/29 05:59:53 craigmcc Exp $
- * $Revision: 1.6 $
- * $Date: 2000/04/29 05:59:53 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseBase.java,v 1.7 2000/04/30 01:23:20 craigmcc Exp $
+ * $Revision: 1.7 $
+ * $Date: 2000/04/30 01:23:20 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * 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
+ * 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"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.tomcat.connector;
@@ -87,7 +87,7 @@
* the connector-specific methods need to be implemented.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.6 $ $Date: 2000/04/29 05:59:53 $
+ * @version $Revision: 1.7 $ $Date: 2000/04/30 01:23:20 $
*/
public abstract class ResponseBase
@@ -100,7 +100,7 @@
/**
* The buffer through which all of our output bytes are passed.
*/
- protected byte[] buffer = new byte[1];
+ protected byte[] buffer = new byte[1024];
/**
1.3 +12 -12 jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseStream.java
Index: ResponseStream.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseStream.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ResponseStream.java 2000/04/18 03:45:15 1.2
+++ ResponseStream.java 2000/04/30 01:23:20 1.3
@@ -1,13 +1,13 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseStream.java,v 1.2 2000/04/18 03:45:15 craigmcc Exp $
- * $Revision: 1.2 $
- * $Date: 2000/04/18 03:45:15 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseStream.java,v 1.3 2000/04/30 01:23:20 craigmcc Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/04/30 01:23:20 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * 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
+ * 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"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.tomcat.connector;
@@ -79,7 +79,7 @@
* enforce not writing more than that many bytes on the underlying stream.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.2 $ $Date: 2000/04/18 03:45:15 $
+ * @version $Revision: 1.3 $ $Date: 2000/04/30 01:23:20 $
*/
final class ResponseStream
@@ -156,7 +156,7 @@
public void close() throws IOException {
if (closed)
- throw new IOException(sm.getString("responseBase.close.closed"));
+ throw new IOException(sm.getString("responseStream.close.closed"));
response.getResponse().flushBuffer();
closed = true;
@@ -171,7 +171,7 @@
public void flush() throws IOException {
if (closed)
- throw new IOException(sm.getString("responseBase.flush.closed"));
+ throw new IOException(sm.getString("responseStream.flush.closed"));
response.getResponse().flushBuffer();
1.5 +11 -10 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- StandardContextValve.java 2000/04/23 01:42:33 1.4
+++ StandardContextValve.java 2000/04/30 01:23:21 1.5
@@ -1,13 +1,13 @@
/*
- * $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 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardContextValve.java,v 1.5 2000/04/30 01:23:21 craigmcc Exp $
+ * $Revision: 1.5 $
+ * $Date: 2000/04/30 01:23:21 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * 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
+ * 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"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.tomcat.core;
@@ -85,7 +85,7 @@
* when processing HTTP requests.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.4 $ $Date: 2000/04/23 01:42:33 $
+ * @version $Revision: 1.5 $ $Date: 2000/04/30 01:23:21 $
*/
final class StandardContextValve
@@ -136,6 +136,7 @@
}
// Ask this Wrapper to process this Request
+ response.setContext(context);
wrapper.invoke(request, response);
}
1.8 +13 -12 jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java
Index: StandardWrapper.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- StandardWrapper.java 2000/04/29 18:24:25 1.7
+++ StandardWrapper.java 2000/04/30 01:23:22 1.8
@@ -1,13 +1,13 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v 1.7 2000/04/29 18:24:25 craigmcc Exp $
- * $Revision: 1.7 $
- * $Date: 2000/04/29 18:24:25 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v 1.8 2000/04/30 01:23:22 craigmcc Exp $
+ * $Revision: 1.8 $
+ * $Date: 2000/04/30 01:23:22 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * 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
+ * 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"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.tomcat.core;
@@ -96,7 +96,7 @@
* make them efficient are counter-productive.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.7 $ $Date: 2000/04/29 18:24:25 $
+ * @version $Revision: 1.8 $ $Date: 2000/04/30 01:23:22 $
*/
public final class StandardWrapper
@@ -130,7 +130,7 @@
/**
* The debugging detail level for this component.
*/
- private int debug = 2;
+ private int debug = 0;
/**
@@ -441,7 +441,8 @@
// If not SingleThreadedModel, return the same instance every time
if (!singleThreadModel) {
- log(" Returning non-STM instance");
+ if (debug > 1)
+ log(" Returning non-STM instance");
return (instance);
}
1.7 +33 -6 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StandardWrapperValve.java 2000/04/29 23:20:33 1.6
+++ StandardWrapperValve.java 2000/04/30 01:23:22 1.7
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java,v 1.6 2000/04/29 23:20:33 craigmcc Exp $
- * $Revision: 1.6 $
- * $Date: 2000/04/29 23:20:33 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java,v 1.7 2000/04/30 01:23:22 craigmcc Exp $
+ * $Revision: 1.7 $
+ * $Date: 2000/04/30 01:23:22 $
*
* ====================================================================
*
@@ -66,8 +66,10 @@
import java.io.IOException;
+import java.io.PrintWriter;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
@@ -87,7 +89,7 @@
* <code>StandardWrapper</code> container implementation.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.6 $ $Date: 2000/04/29 23:20:33 $
+ * @version $Revision: 1.7 $ $Date: 2000/04/30 01:23:22 $
*/
final class StandardWrapperValve
@@ -126,7 +128,11 @@
Servlet servlet = null;
try {
+
+ // Allocate a servlet instance
servlet = wrapper.allocate();
+
+ // Call the service() method of this instance
if ((servlet instanceof HttpServlet) &&
(sreq instanceof HttpServletRequest) &&
(sres instanceof HttpServletResponse)) {
@@ -137,9 +143,30 @@
} else {
servlet.service(sreq, sres);
}
+
+ // Deallocate the servlet instance
wrapper.deallocate(servlet);
- log(" Flushing response buffer");
- sres.flushBuffer();
+
+ // Flush the output buffer
+ PrintWriter writer = null;
+ try {
+ writer = sres.getWriter();
+ try {
+ writer.flush();
+ writer.close();
+ } catch (Throwable t) {
+ ;
+ }
+ } catch (IllegalStateException e) {
+ ServletOutputStream stream = sres.getOutputStream();
+ try {
+ stream.flush();
+ stream.close();
+ } catch (Throwable t) {
+ ;
+ }
+ }
+
} catch (Throwable t) {
log(sm.getString("standardWrapper.servletException"), t);
wrapper.deallocate(servlet);