今天主要加入了自定义的报错功能
源码如下
1.
<%@ page language="java" contentType="text/html; charset=UTF-8" isErrorPage="true"
pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>不好意思您访问的页面不存在</title>
<link href="h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="h-ui/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="page-404 text-c">
<p class="error-title"><i class="Hui-iconfont"></i>404</p>
<p class="error-description">不好意思,您访问的页面不存在~</p>
</div>
</body>
</html>
运行出现“访问的界面不存在”错误是弹出如下界面
![](https://i-blog.csdnimg.cn/blog_migrate/6354f94cbec8ea3334d25289269339ec.png)
2.
源码
<%@ page language="java" contentType="text/html; charset=UTF-8" isErrorPage="true"
pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>服务端错误</title>
<link href="h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="h-ui/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="page-404 text-c">
<p class="error-title"><i class="Hui-iconfont"></i>500</p>
<p class="error-description">不好意思,服务端错误啦~</p>
</div>
</body>
</html>
当出现“服务端错误”时弹出如下界面
![](https://i-blog.csdnimg.cn/blog_migrate/91afe8c3aff53fe5dd9817ccca94f156.png)