tomcat-users mailing list archives

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

André,

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklr5g4ACgkQ9CaO5/Lv0PA8sACgpmv/U0O/DsFHvow33QllQeIF
VxkAoILFKW+1R1ljGegbVQAWNutNlyDE
=WrCw
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message