How to handle UTF-8 characters in struts ApplicationResources.properties

ningjun.wang_at_lexisnexis.com
Date: 01/10/05


Date: 10 Jan 2005 11:14:01 -0800

I used WSAD5 and struts to develop a Japaness site using UTF-8. I
defined error message in strut's ApplicationResources.properties file.
If the error message contains Japaness characters (UTF-8 encoding), it
will not be displayed correctly in the browser.

For example ApplicationResources.properties contains the following:

error.login.invalidCredential=吉川英一郎: Your userName/password
is invalid. Please try again.

I raise this error in my action class as follow:

errors.add("login", new ActionError("error.login.invalidCredential"));

In the JSP I displayed the error using
<html:errors />

When I run the application, the JSP display the following message:

吉川英一郎: Your userName/password is invalid.
Please try again.

Note that the English characters are displayed correctly but not the
Japaness characters.

What is wrong?

Ningjun