SpringBoot运行后,前端出现Whitelabel Error Page

前端出现:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

There was an unexpected error (type=Internal Server Error, status=404).
 
控制台中包含:

getResource(templates/error/4xx.html)

--------------------------------------------------------------------------------------------

templates中的html为动态页面,需要通过控制器访问。

检查Controller中的RequestMapping

标在类和方法上的注释

-------------------------------------------------------------------------------------------

访问不到资源的情况:

1.资源不存在

2.资源文件路径错误

3.Controller和SpringBoot程序入口的位置

4.环境配置

5.请求的编写错误

posted @ 2022-05-16 18:20  NetUSA  阅读(482)  评论(0)    收藏  举报