springboot工程添加404页面

 首先在/src/main/resources下创建文件夹/public/error

在文件夹里创建html页面,jsp页面不可以。

<html>
<body>
    <img src="/img/error/404.gif">
</body>
</html>

访问报错时触发

原文地址:https://www.cnblogs.com/chuijingjing/p/9956298.html