I’m using Jetty to test a webservice we have and I am trying to get it to respond with no charset under the content-type header.
Does anyone know how to do this?
I’ve tried intercepting the Response and setting the CharacterEncoding to null or ” but that gives Exceptions.
I am using Jetty 6.1.6.
I tried it my self now, but I must admit, my jetty is a very old one (4.2., but does everything the way I need it). I compared it to tomcat (4.1.29, old too). I checked the content type with the following code:
And the result was as follows:
Servlet code:
=>
tomcat: ;charset=ISO-8859-1
jetty:
Servlet code:
=>
tomcat: text/plain;charset=ISO-8859-1
jetty: text/plain
Servlet code:
=>
tomcat: text/plain;charset=UTF-8
jetty: text/plain;charset=UTF-8
So it looks as if the older jetty does exactly what you want, while tomcat does what you got from the newer jetty.