N
ningjun.wang
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
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