本章讲解:spring boot :error返回的页面
对于输错的网址:或者是不存在的自己设计错误页面:
例如url=localhost:8222/123(错误网址)
原本写的只是Whitelabel Error Page(白板错误页面)
修改后:当然可以根据4xxx,5xx来设置不同的message
1.定义白页 (whilelabel)
在template下写一个error.html
error.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>==...><...错误页面...><...==</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="/css/bootstrap.min.css" />
<link rel="stylesheet" href="/css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="/css/transaction.css"/>
<script src="/js/jquery-3.4.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
</head>
<body>
<!--head 头部分-->
<<