Jetty default encoding

Cantor, Scott cantor.2 at osu.edu
Wed Jun 4 15:26:24 EDT 2014


Just FYI, it appears to me that Jetty has a very hardwired default of
ISO-8859-1 for text/html and text/plain content that you might be able to
override by injecting a file in the right place in the classpath.

There doesn't appear to be a simple connector property like Tomcat has to
universally switch things to UTF-8. I suspect that's going to cause
problems.

As it is, I was going through hell trying to get views to stop coming back
as 8859-1 until I globally overrode the charset in the ViewResolver beans,
because Spring MVC also defaults to it, and Jetty was making more
assumptions based on that even when I overrode the content type myself.

I was finally able to generate an XML response inside a Velocity template,
which means we can generate non-browser responses like SOAP faults out of
the same error view used for browser errors.

-- Scott




More information about the dev mailing list