Tomcat in last versions use http-1.1 chunked encoding.
As far as I know you can downgrade to http 1.0 in the client connection or better using 1.1 setting in the HTTP HEADER Connection=close.
HttpURLConnection conn = (HttpURLConnection) conn.openConnection(); conn.setRequestProperty("Connection","close");
I think I have a similar problem.
I'm just starting to learn JBoss and J2EE.
I just inherited a huge Web project running on JBoss. Part of this inheritance is the truckload of bugs, of course.
My problem is:
The server always serves up pages with the charset set to "Shift_JIS", even if the JSP pages explicitly states that the pages should have UTF-8 charset and encoding.
Hence, once the pages are served, if you do a view-source, you'll see all the JSP code stating UTF-8 as the charset+encoding.
However, if you submit a form, the parameters in the URI are all encoded in SJIS, thereby causing never-ending probelms on the server side.
What do I need to do to make the pages served as UTF-8? Are there any configuration settings I need to override?
OK, I found the solution (and cause) of the problem. Apparently .NET doesn't implement HTTP/1.1 correctly, so needs the following line adding to the connector element of the Tomcat server.xml file:
restrictedUserAgents="^.*MS Web Services Client Protocol.*$"
As with everything, once you know what to look for, you find it! There is an entry in the Wiki about it ;-)