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 properties文件编码设置
Window->Preferences->General->Content types->Java Properties Files->Default Encoding->utf-8
修改Eclipse格式化代默认长度
1.Java代码
打开Eclipse的Window菜单,然后
Preferences->Java->Code Style->Formatter->Edit ->Line Wrapping->Maximum line width:默认80
加个0,改成800就行了。
2.CSS代码
Window->Preferences->Web->CSS Files->Editor->Line width:默认为72
加个0,改为720保存。
3.Html代码
Window->Preferences->Web->HTML Files->Editor->Line width:默认为72
加个0,改为720保存。
4.JSP代码
Window->Preferences->Web->JSP Files->Editor->Line width:默认为72
加个0,改为720保存。
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="s" uri="/struts-tags"%>
<!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>
Eclipse Jee JSP文件添加JSTL模板
Window->Preferences->Web->JSP FIles->Editor->Templates->New
Name:New JSP JSTL
Context:New JSP
description:JSTL
<%@ 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>