tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Default character encoding for ServletRequest
Date Thu, 01 Oct 2009 10:37:50 GMT
Halm Reusser wrote:
> Hi,
> Calling <%= request.getCharacterEncoding() %> in a jsp deployed in a 
> Tomcat 6.0.20 container returns null.
> Is there any possibility to force a default CharacterEncoding for such 
> requests?
Don't worry, there is already a default.
The only problem is to figure out what it is..

My guess, at this stage, is that it is either iso-8859-1 (which is the 
default charset for the HTTP protocol), or else it is tied to whatever 
"locale" your Tomcat's JVM has been started under.
It would also depend on whether the request which you are processing is 
a GET or a POST.
And, whatever you would decide to set as a default at the server level, 
you can still not be quite sure that the client's choice matches yours.

Confused enough ?
Sorry, but that's about the most definite thing that can be said on the 
subject, considering the various often conflicting specifications that 
play a role here.

If the past is any guide however, this post will probably trigger a 
lively discussion.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message