web.xml配置文件:
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/jsp/error/404.jsp</location>
</error-page>
404.jsp页面显示:
<html>
<body>
<h2>404-Error:无效的地址</h2>
</body>
</html>
启动程序,浏览器输入后,显示乱码。
jsp文件本身编码格式也是utf-8,web.xml也配置了编码格式是utf-8。结果还是乱码。
其实错误本身在jsp的页面上:
404.jsp页面显示:
<%@ page language="java" pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<html>
<body>
<h2>404-Error:无效的地址</h2>
</body>
</html>