eclipse乱码问题

工作空间编码

Preference——>General——>Workspace

单个项目编码

右击项目

Resource

Other

单个文件编码

同上,右击那个文件即可,其他与上面一样

改变jsp模板

再改一下jsp默认模板的编码格式

Windows——>Preference——>Web——>JSP Files——>Editor——>Templates

修改

将 encoding写死

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
<!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=utf-8">
<title>Insert title here</title>
</head>
<body>
<f:view>
${cursor}
</f:view>
</body>
</html>

 补充:

Preferences直接搜搜jsp

encoding 选择utf-8

原文地址:https://www.cnblogs.com/phdeblog/p/14050022.html