This application has no explicit mapping for /error, so you are seeing this as a fallback.
因为使用的是html文件,没有模板引擎,需要导入thymeleaf依赖
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>
xmlns:th=“http://www.thymeleaf.org”
ps:templates包里的页面只能由Controller调用