Author: remy.maucherat(a)jboss.com
Date: 2007-12-23 16:53:10 -0500 (Sun, 23 Dec 2007)
New Revision: 383
Modified:
trunk/java/org/apache/catalina/connector/Response.java
trunk/java/org/apache/catalina/core/ApplicationContext.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/config/context.xml
Log:
- Two minor Tomcat patches: improve reset of response, and getResourceAsStream needs a
leading slash.
Modified: trunk/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Response.java 2007-12-21 16:34:59 UTC (rev
382)
+++ trunk/java/org/apache/catalina/connector/Response.java 2007-12-23 21:53:10 UTC (rev
383)
@@ -665,6 +665,9 @@
coyoteResponse.reset();
outputBuffer.reset();
+ usingOutputStream = false;
+ usingWriter = false;
+ isCharacterEncodingSet = false;
}
Modified: trunk/java/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContext.java 2007-12-21 16:34:59 UTC
(rev 382)
+++ trunk/java/org/apache/catalina/core/ApplicationContext.java 2007-12-23 21:53:10 UTC
(rev 383)
@@ -507,7 +507,7 @@
public InputStream getResourceAsStream(String path) {
path = normalize(path);
- if (path == null)
+ if (path == null || !path.startsWith("/"))
return (null);
DirContext resources = context.getResources();
@@ -865,7 +865,7 @@
String normalized = path;
- // Normalize the slashes and add leading slash if necessary
+ // Normalize the slashes
if (normalized.indexOf('\\') >= 0)
normalized = normalized.replace('\\', '/');
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2007-12-21 16:34:59 UTC (rev 382)
+++ trunk/webapps/docs/changelog.xml 2007-12-23 21:53:10 UTC (rev 383)
@@ -111,6 +111,15 @@
Fix possible race condtion when a webapp classloader has external class
repositories defined. (remm)
</fix>
+ <fix>
+ <bug>43236</bug>: When resetting the response, also reset the flags
+ associated with using a writer or an output stream to allow the user to
+ change character set after the reset. (markt)
+ </fix>
+ <fix>
+ <bug>43241</bug>: Make ServletContext.getResourceAsStream() conform
to
+ the specification. Patch provided by John Kew. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
Modified: trunk/webapps/docs/config/context.xml
===================================================================
--- trunk/webapps/docs/config/context.xml 2007-12-21 16:34:59 UTC (rev 382)
+++ trunk/webapps/docs/config/context.xml 2007-12-23 21:53:10 UTC (rev 383)
@@ -162,7 +162,12 @@
<attribute name="privileged" required="false">
<p>Set to <code>true</code> to allow this context to use
container
- servlets, like the manager servlet.</p>
+ servlets, like the manager servlet. Use of the
<code>privileged</code>
+ attribute will change the context's parent class loader to be the
+ <em>Server</em> class loader rather than the
<em>Shared</em> class
+ loader. Note that in a default installation, the <em>Common</em>
class
+ loader is used for both the <em>Server</em> and the
<em>Shared</em>
+ class loaders.</p>
</attribute>
<attribute name="path" required="false">