Eclipse Jee项目编码设置
Window->Preferences->General->Wordspace->Text file encoding->Other->utf-8
Eclipse Jee JSP文件编码设置
Window->Preferences->Web->JSP FIles->encoding->utf-8
Eclipse Jee JSP文件添加Struts2模板
Window->Preferences->Web->JSP FIles->Editor->Templates->New
Name:New JSP Struts2
Context:New JSP
description:Struts2
<%@ page contentType="text/html; charset=${encoding}" pageEncoding="${encoding}"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">
<title>Insert title here</title>
</head>
<body>
${cursor}
</body>
</html>
Window->Preferences->General->Wordspace->Text file encoding->Other->utf-8
Eclipse Jee JSP文件编码设置
Window->Preferences->Web->JSP FIles->encoding->utf-8
Eclipse Jee JSP文件添加Struts2模板
Window->Preferences->Web->JSP FIles->Editor->Templates->New
Name:New JSP Struts2
Context:New JSP
description:Struts2
<%@ page contentType="text/html; charset=${encoding}" pageEncoding="${encoding}"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">
<title>Insert title here</title>
</head>
<body>
${cursor}
</body>
</html>