转载请注明出处:https://oldnoop.tech/c/159.html
在src/main/resources下创建文件夹public, 在public下创建文件夹error,
src/main/resources
|---public
|---error
|--404.html
|--500.html
添加文件404.html
------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>错误</title>
</head>
<body>
您查找的资源消失了!
</body>
</html>
添加文件500.html
------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>错误</title>
</head>
<body>
服务器内部错误!
</body>
</html>