Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

WAR file works in tomcat but gives UTF-8 errors in Jetty, why?

0

57 views

i have java webapp that i develop locally with m2eclips+jetty+eclipse, and deploy nightly to tomcat. With jetty, i get UTF-8 error when i send ajax posts to the server. The same code works fine in tomcat.

On the jetty side, i can see all the post params, and everything gets logged to the logfiles, but then a runtime exception is thrown saying that the encoding is unrecognized.

My pages are all encoded as utf-8, and the headers in the Post are utf-8. it appears that something in jetty or eclipse doesnt like the utf-8 encoding and I cant figure out what it might be.

any thoughts?

asked March 22, 2011 5:01 pm CDT
posted via StackOverflow

2 Answers

2
 
java.io.UnsupportedEncodingException: UTF-8;

That semicolon is suspicious. It isn't part of the normal error message/trace.

Sure that you or Ajax didn't set Content-Type to text/html;charset=UTF-8; or something? Use a HTTP request tracker like Firebug to be sure. I would consider it as another ugly bug in Jetty though. It is apparently not expecting more than two attributes in the header. If you like Jetty, report it to the Jetty guys.

answered March 24, 2011 3:42 am CDT
0
Best answer
 

i found the answer to my question. I am using the apache click framework and had recently upgraded from version 2.2.0 to 2.3.0-RC1. A bug was introduced in version 2.3.0-RC1 that caused duplicate contentType headers to be sent on AJAX requests. Tomcat was able to gracefully handle the mis-constructed header, Jetty was not.

i ended up applying a temp patch by overriding the problem function.

answered April 1, 2011 7:13 am CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
Jetty or Tomcat?
January 1, 2011