2018-03-08
springboot-配置静态错误页面
springboot 评论:0 浏览:98

转载请注明出处: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>



  • 转载请注明出处:https://oldnoop.tech/c/159.html

Copyright © 2018 oldnoop.tech. All Rights Reserved

鄂ICP备2023022735号-1