How to handle UTF-8 characters in struts ApplicationResources.properties
ningjun.wang_at_lexisnexis.com
Date: 01/10/05
- Next message: julzmagoo_at_hotmail.com: "Multiple servlets ... one file"
- Previous message: Virgil Green: "Re: private final?"
- Next in thread: John C. Bollinger: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Reply: John C. Bollinger: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Reply: Oscar kind: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Reply: Andrew Thompson: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Reply: yzzzzz: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: julzmagoo_at_hotmail.com: "Multiple servlets ... one file"
- Previous message: Virgil Green: "Re: private final?"
- Next in thread: John C. Bollinger: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Reply: John C. Bollinger: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Reply: Oscar kind: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Reply: Andrew Thompson: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Reply: yzzzzz: "Re: How to handle UTF-8 characters in struts ApplicationResources.properties"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|