0.環境html
Eclipse IDE for Java EE Developers (4.3.2)java
win8.1系統eclipse
1.緣由jsp
Eclipse自帶新建JSP爲:ui
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
而ISO-8859-1不支持中文。spa
2.嘗試解決code
①.改成UTF-8htm
因爲自帶模板爲:blog
<%@ page language="java" contentType="text/html; charset=${encoding}" pageEncoding="${encoding}"%>
在eclipse中依次點擊Window---->Preference---->Web---->JSP Files,修改Encoding爲ISO 10646/Unicode(UTF-8)便可!ip
②.改成GBK、GB2312
(一)網上方法:
進入Eclipse的主目錄,搜索com.genuitec.eclipse.wizards_*,搜索出來的只有一個JAR。把這個jar拷貝到另外一個目錄,用rar把這個jar打開,進入templates/jsp的目錄,找到-Jsp.vtl,打開,修改完畢後保存。
搜索com.genuitec.eclipse.wizards_*無果
(二)在eclipse中依次點擊Window---->Preference---->Web---->JSP Files---->Editor---->Templetes---->New
以下圖所示:
完成!