Tomcat4: Default Page Encoding UTF8  
Author Message
christian





PostPosted: 2003-11-5 23:40:00 Top

java-programmer, Tomcat4: Default Page Encoding UTF8 Hi,

I am using Tomcat 4.1.27 running servlets which worked
perfectly under Tomcat 3. The problem is: (unfortunately)
the special characters (like german umlaute) are not
html encoded. Under tomcat 3 this was no problem, but with
the new tomcat the page-encoding is wrong. When I manually
change the page encoding in the browser to utf-8 everything
is OK. I could now go through all servlets and change the
content-type to charset utf-8, but I try to avoid this.
(as there where not written by me).

Is there any possiblilty the change the default page encoding
to utf-8? (like in the server.xml or so)

Thank you for any help!!!

Christian
 
Sudsy





PostPosted: 2003-11-6 0:49:00 Top

java-programmer >> Tomcat4: Default Page Encoding UTF8 Christian Hanke wrote:
> Is there any possiblilty the change the default page encoding
> to utf-8? (like in the server.xml or so)
>
> Thank you for any help!!!
>
> Christian

You can specify the default in your WEB-INF/struts-config.xml
file. I use this configuration:

<controller
contentType="text/html;charset=UTF-8"
nocache="true"
processorClass="org.apache.struts.action.RequestProcessor"/>

Hope this helps!