Springboot - 错误页面重定向 - 根据错误码重定向到指定页面
- 在resources目录下建立文件夹public
- 在public目录下建立文件夹error
- 在error文件夹下放置404.html,500.html等各种错误页面
在resources下的templates文件夹下,创建error.html页面
error.html http状态有很多,当遇到一个你没有定义的错误时,会跳转到error.html
在resources下的templates文件夹下,创建error.html页面
error.html
http状态有很多,当遇到一个你没有定义的错误时,会跳转到error.html