2010/6/17 Felix Schumacher <felix.schumac...@internetallee.de>: > For the moment I have written a filter, which sets a default encoding, as > soon as Response.setContentType(String type) is called and > type.startsWith("text/"). That works for the moment, but I would prefer the > solution described in above thread.
I know that setting charset in a mime-mapping works, e.g.: <mime-mapping> <extension>htm</extension> <mime-type>text/html;charset=iso-8859-1</mime-type> </mime-mapping> <mime-mapping> <extension>html</extension> <mime-type>text/html;charset=iso-8859-1</mime-type> </mime-mapping> Note, that it would be better if the mime type set by a HTTP header and the one provided by HTML tag match strictly (case sensitively). Otherwise some browsers will start guessing. IIRC, the HTML spec says that the HTTP header takes precedence, but not all browsers follow it strictly. Also there is AddDefaultCharsetFilter in Tomcat 7. It is similar to what you are doing, see its JavaDoc and source code. > apache httpd thinks it would be better to append a > charset to the response I wonder, if there is a way to improve your Apache HTTPD configuration. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org