tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: [users@httpd] Problem with mod_headers ?
Date Tue, 13 Jan 2009 00:53:34 GMT
Hash: SHA1


André Warnier wrote:
> - the only viable solution in my case is thus to make sure that the
> Tomcat servlet issues the correct Content-Type header in the first
> place.  If the servlet itself cannot be modified, then a servlet filter
> wrapping the response in a javax.servlet.ServletResponseWrapper wrapper
> would be the way to go.  The wrapper should override the methods by
> which the servlet sets and/or obtains the response encoding.

Note that this is a very common use case for filters: wrap the request
(or, in this case, the response) with a custom object that extends
ServletRequestWrapper (or ServletResponseWrapper) and overrides the
appropriate methods, then delegate processing to the next processor in
the filter chain.

You probably want to use HttpServletResponseWrapper in stead of the more
generic wrapper class.

> (In my case, the servlet has to "keep believing" that its response
> output stream is iso-8859-1, otherwise it does the wrong charset
> translations from its internal Unicode strings to the 8-bit response
> stream.)

That's a pretty significant bug!

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


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message