How to display chinese chars in JSP / encoding UTF-8 without <@page encoding 2007-01-11 - By Markus Sch?nhaber
Back PATTUS, Jean-Philippe wrote:
> i'm trying to display chinese chars in my web application. > I have managed to display these characters by adding this following > directive in each jsp : <%@ page contentType="text/html; charset=UTF-8 (See http://UTF-8.ora-code.com)"%>. > It works fine. > But, now i'm looking for a way to change the default charset (Iso 8859-1) > used by Tomcat for the jsp compilation. I want to set this information in > only one place(why not in the web.xml), to avoid to add the directive tag > on my each jsp file. > > Let me know if you have any ideas on the subject.
Two ideas com to my mind: 1. Change the JSPs to use XML syntax. For those, the default encoding is UTF-8 (See http://UTF-8.ora-code.com). 2. Add something like <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <page-encoding>UTF-8 (See http://UTF-8.ora-code.com)</page-encoding> </jsp-property-group> </jsp-config> to the web.xml of your application. The snippet above is written from memory. So it may not be correct but should give you the idea what to look for.
Regards mks
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To start a new topic, e-mail: users@(protected) To unsubscribe, e-mail: users-unsubscribe@(protected) For additional commands, e-mail: users-help@(protected)
|
|