一,中文出现乱码
原始代码
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!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=ISO-8859-1">
<title>chj65的博客</title>
</head>
<body>
chj65的博客
</body>
</html>
出现以下·所示情况,选择以utf-8编码另存为,运行后
中文出现乱码,如图
解决方案,亲测
将开头部分
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
改为
<%@ page language="java" contentType="text/html"
pageEncoding="utf-8"%>
删除charset=ISO-8859-1",将 pageEncoding=“ISO-8859-1”%改为 pageEncoding=“utf-8”%,即可
修改后
JSP文件报错
Multiple annotations found at this line
Unknown tag (jap:forward)