运行SpringBoot测试页面,显示错误信息如下:
This application has no explicit mapping for /error, so you are seeing this as a fallback.Thu Aug 26 21:19:19 CST 2021There was an unexpected error (type=Internal Server Error, status=500).
解决方案如下:
在配置文件applicaiton.properities中添加关于thymeleaf模板的路径和后缀配置项:
#设定模板的路径 spring.thymeleaf.prefix=classpath:/templates/ # 构建URL时附加查看名称的后缀.(默认就是 html的结尾的) spring.thymeleaf.suffix=.html