Tomcat4: Default Page Encoding UTF8

Discussion in 'Java' started by Christian Hanke, Nov 5, 2003.

  1. 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
    Christian Hanke, Nov 5, 2003
    #1
    1. Advertising

  2. Christian Hanke

    Sudsy Guest

    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!
    Sudsy, Nov 5, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    18,839
    Jon Skeet [C# MVP]
    Jun 9, 2004
  2. robert walker
    Replies:
    2
    Views:
    494
    John C. Bollinger
    Aug 4, 2003
  3. davidepp
    Replies:
    2
    Views:
    413
    davidepp
    Aug 21, 2003
  4. Replies:
    2
    Views:
    597
    Rohit Gupta
    Jun 20, 2005
  5. gry
    Replies:
    2
    Views:
    726
    Alf P. Steinbach
    Mar 13, 2012
Loading...

Share This Page