tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: ErrorReportValve's char encoding ignored
Date Wed, 15 May 2013 14:35:21 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Micheal,

On 5/15/13 3:46 AM, Michael-O wrote:
> I have modified the ErrorReportValve's messages outside of the 
> one-byte range and the output got mangled. The response does not 
> contain a char encoding anymore.

Can you be more specific? What exactly did you modify, and how did you
modify it? What are the exact HTTP response headers that you get?

> I know that the error valve does this:
> 
> response.setContentType("text/html"); 
> response.setCharacterEncoding("utf-8");
> 
> but the setCharEnc method is completely ignored. Because the var 
> usingWriter is already set to true. This happens in the 
> ApplicationDispatcher#doForward line 393/394 when a servlet
> performs a forward.

Looking at Tomcat 6.0.x/trunk line 393 is part of the cleanup code,
and the response PrintWriter is immediately closed. That does not
appear to have changed since 6.0.35. At this point, the request should
be /over/.

What else is going on? Is any content being generated before the
ErrorReportValve gets invoked? If the response has already been
committed, then Tomcat can't re-write the response headers.

> Though a response.getReporter() is used but this one is completely 
> unaware of the char encoding.
> 
> I am on Tomcat 6.0.35.

Where is response.getReporter being called?

> I presume this to be a bug. Should I file a BZ issue?

Um... not yet.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRk50oAAoJEBzwKT+lPKRYrm0QAJGPMUnsGRtI6lues3lrTrZ3
1yJZ4HjE+rXLONXQ8tMy6VloNry40kAAfnenHQlZBu3HKdmgbK4z3KZnbARbbVXO
eAM6bMU4vAo7ftiDozECB+xL7l5MViIy6GeS/2cZXSMEcZxbEulQouyHaZxbCTrn
D8yNJQ5jtJpYlNuoR6bf/27yrxxiezPzyKs5qRBCJ5z1psDmd/RLyew6LQsau3ew
kI3BLnMoNFGnqh+YyyKgDzhpJhredHScVHCb7cmcyW/iEpuc5nJ4XMOQkzdLwhxT
8N8QZgzsk6DYsMzZeIcy/+WRltPi3UrcYBR6lNfSsmwkkhCYTXQm+dYdkkAIb7t8
Jg4y9Fkm5xKrVIzNa40Vt9pt3u8qYU6i2p1GKqE6zCIIsvxBW+vgCKvoIftDMCat
oJ5P4Noy6NYHhdkSLV6rC0W6svu0MNQpW6msSghYwZf9ZQdY9msIxFU8e2alHLWE
wMFMMiCeeOsp1wFX5qxmWi1C1B7+vQUSZc3IIedRW6Afene+tQH0+PtAEqtoeha0
BfTVXY/IW11jF3kjyakjzuo0kRa2sw6Dkh6kLglc7egln4kw/7aNC0j6icO+Bcmr
hGheRaItjVhUb+adpaQM66ENGjt/h+b20bp7EfA6AopNCBEDxoGA9lRdBXjVJKV5
3+Oo7c+CctMAiaqd6ayl
=4xg0
-----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