tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Davidson <bi...@seatadvisor.com>
Subject Re: Unable to display UK Pound Sign
Date Mon, 12 May 2008 20:08:08 GMT
I had some more thoughts on this.  I'm curious how you manage to have
an encoding type mismatch.  In JSP's, encoding is set with the
"<%@page%>" or "<jsp:directive.page>" tags with "encodingType" or
"contentType" attributes.  In servlets, it's set with
javax.servlet.ServletResponse.setContentType(String) though that
needs to be called /before/ ServletResponse.getWriter() is called.

You can also set defaults in the web.xml for the app or Tomcat in the
"<page-encoding>" sub element of the "<jsp-property-group>" sub
element of the "<jsp-config>" element.

If you're getting the data out of a database, presumably, it's getting into
a Java String, which is then getting output as ISO-8859-1.  However,
your markup presumably is being identified to the browser in the
Content-Type HTTP header as as something else, most likely UTF-8.
You need to either fix your output to match your header or fix your
header to match your output.

I like the Live HTTP Headers extension for Firefox for examining
HTTP headers:

https://addons.mozilla.org/en-US/firefox/addon/3829

--Bill Davidson





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message