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>
posted @ 2018-11-05 02:58  梦飞扬~  阅读(2267)  评论(0编辑  收藏  举报