tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Filter cuts response in Tomcat 5.5.20
Date Mon, 08 Sep 2008 22:11:37 GMT
Hash: SHA1


Jesse Klaasse wrote:
> However, it isn't working as it should be. I actually see the "PRE" and
> "POST" lines in the Ajax output, however, most of the time there is nothing
> between them. And when I print the response length, it's 0 most of the time.
> This is all working fine using our old development platform (based on Resin
> 3.0.14), but it isn't working on the new one (based on Tomcat 5.5.20).

I wonder about this method in

	public PrintWriter getWriter() throws IOException {
		return new PrintWriter(getOutputStream(), true);

I think you want to return the same object each time you call getWriter.
Perhaps you could cache the PrintWriter you create and return that each
time, instead of just creating a new one each time. If you don't you
could create a situation where flushing behavior might render the page
in odd ways.

Also, you are calling getOutputStream in this method, which is /not/
overridden in GenericResponseWrapper, which means that getWriter
actually avoids your ByteArrayOutputStream altogether (which is why you
have zero bytes in the output). I'm a little confused as to why no
output is generated, anyway, since getOutputStream should return the
same object being used by the Filter itself, so all the data should
eventually make it out of there.

Just to be sure: you are not using FilterServletOutputStream, right?

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message