First problem:
When writing JSP, database operations are involved in it.
Save cocould not be completed
The reason is some characters cocould not be mapped using iso8859-1
<% @ Page language = "java" pageEncoding = "GBK" %>
Set it to GBK or UTF-8, as long as it supports Chinese KO
Second problem:
When compiling jsp page or JAVA class with eclipse, enter Chinese characters directly in the page, save the error prompt "character cannot match ISO-8859-1", because the ISO-8859-1 is English encoding, I want to change it to UTF-8 because it cannot recognize Chinese characters, but I cannot find a place that can change the encoding. First, I open the properties of the project, in "info", we can see that "Text file encoding" is changed to UTF-8 in the world, but there is still an error message. After a long time, we can't decide whether to change it, no one has ever encountered such a problem. The answer to this question is mostly in "edit" --- "set encoding" (as if this is temporary encoding for a separate file ), however, I did not find it in eclipse (I used 3.2, but I don't know why). Later I found another explanation: Set the default encoding:
Window --> preferences --> general --> editor --> text file encoding,
I still cannot find perferences. I am dizzy ~~~~~~~~~,
Next, let's see if there are any encoding settings in other places,
Still not found ..........
Back to perferences, I think the problem can be solved here,
I found "General" -- "Content Types ",
There is a tree text on the right,
Expand and find "JSP", not found at first,
That guy is hiding at the lowest level ...........,
Don't be careless,
"Default encoding ",
The default "ISO-8859-1 ",
Finally,
Remove "ISO-8859-1" and fill in "UTF-8 ",
Click "update ",
OK. Save,
There is no error ..............
This article from CSDN blog: http://blog.csdn.net/xinew/archive/2010/08/06/5794386.aspx
From:
Http://www.cnblogs.com/king1302217/archive/2011/04/18/2019994.html