web页面乱码,JSP页面编码设置
- 解决Web页面访问出现乱码bug,JSP页面首行添加:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mauger</title>
</head>
<body>
<h1>Hello World!</h1>
<h2>世界,你好!哈哈哈哈~</h2>
</body>
</html>