Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8615855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:28:56+00:00 2026-06-12T05:28:56+00:00

We are on a production server which uses Tomcat 7, and for whatever reason,

  • 0

We are on a production server which uses Tomcat 7, and for whatever reason, the administrators refrain from setting the CATALINA_OPTS="-Dfile.encoding=UTF-8" workaround for us.

This means that now when deploying the WAR file, Tomcat returns garbled characters instead of their Unicode counterparts.

We have also included this in our web.xml, to no avail:

<filter>
    <filter-name>encoder</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
        <param-name>encoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
        <param-name>forceEncoding</param-name>
        <param-value>true</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>encoder</filter-name>
    <url-pattern>*</url-pattern>
</filter-mapping>

How do we manage this without sending a man to breach into the server room and modify the configuration?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:28:57+00:00Added an answer on June 12, 2026 at 5:28 am

    First of all, it’s important to understand what the -Dfile.encoding=UTF-8 exactly does. It is a Sun/Oracle JVM-specific setting (which thus don’t necessarily work in all other JVMs!) which basically instructs the JVM to read the Java .class files using the given encoding instead of the platform default one. So, setting this would only solve any possible Mojibake problems which is caused by using "special characters" in Java class/variable names or hardcoded String values in Java classes (yes, you read it right: only Java classes, not other files, thus definitely not properties files or JSF XHTML files, etc).

    In all honesty, I can hardly imagine that this is the right solution to your concrete problem. Why would one ever use special characters straight in Java classes? Class/variable names should be in all English and localized text should be placed in resource bundle files. Every self respected Java developer adeheres this convention.

    Given that fact, and assuming that you are also not using special characters in Java classes at all, I thus believe that your concrete problem is caused by something else. The problem symptoms are not specific enough described (at which step exactly does it fail? which characters exactly do you expect and get instead? etc) to see the possible root cause of your concrete problem. I can at least tell that the URL pattern of your Spring filter is completely wrong. It must be mapped on /*

    <filter-mapping>
        <filter-name>encoder</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    

    (by the way, you don’t necessarily need Spring for this, just a custom Filter with only 2 or 3 lines in doFilter() implementation is already sufficient)

    See also:

    • Unicode – How to get the characters right?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Glassfish server in production which uses JDBC Realm for authentication. It
I am trying to create a development server from a production server from which
I have a production server which uses Apache / FastCGI / DJango to serve
I have an asp.net website in my production server which running fine now. Now
I'd like to host a Google Gadget on our production app server which will
We are having this issue with our production servers (apache-tomcat-7.0.6), which is running a
I'm developing an app which uses Spring quite heavily. Spring and the Tomcat Security
I am developing an iPhone app which uses a server somewhere to fetch its
I have a production server running, and a local development one (this one uses
We have Windows Server 2008 as our Production server hosted in RackSpace environment. Following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.