Enter Chinese characters in the newly created JSP file, save the file, and report an error (encoding problem). The article was found in the Forum to solve the problem. Therefore, the article was reprinted.
<% @ Page Language = "Java" Import = "Java. util. * The content in the pageencoding attribute in "pageencoding =" ISO-8859-1 "%> must be consistent with the default encoding method in solution 1. Otherwise, garbled characters may occur.
The original article is as follows:
Create a messagebundle in myeclipse. properties file. If you enter Chinese characters for saving, an error will be prompted: Save cocould not be completed. reason: some characters cannot be mapped using "ISO-8859-1" character encoding. either change the encoding or remove the characters which are not supported by the "ISO-8859-1" character encoding.
Solution 1:
Open the preferences of Eclipse, choose general-> content types, and then modify the right side of the text under the Java properites file encoding method of the default UTF-8, click Update on it!
Solution 2:
1. The Jinto plug-in of eclipse should be used for editing. The native2ascii code of Java will be called automatically to transcode the file.
Jinto plug-in download: http://www.guh-software.de/jinto.html
2 2 eclipse --> preferences... --> in the "Type Filter text" column, enter "content types" for search, and then select
Modify the code of the corresponding file suffix under text on the right.
Then manually call native2ascii to compile the messagebundle_zh_cn.proterites File
Attachment: Install the properties editor in eclipse
In eclipse, "help" --- "Software Update" -- "find and install" -- "search for new feature components to be installed" --- "Next" --- "create remote site "---
Enter "name": Properties editor;
The URL is http://propedit.sourceforge.jp/eclipse/updates,
Let it download the plug-in by itself ..
Find the appropriate properties editor for installation. This plug-in reduces conversion to UTF-8 format and is automatically converted in struts.
In this way, you can install some Eclipse plug-ins by yourself.
From: http://macleo.javaeye.com/blog/661289