1. 程式人生 > >web頁面亂碼,JSP頁面編碼設定

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>