Error resolving template [detail], template might not exist or might not be acces
问题原因:观察控制台错误信息发现,异常是由thymeleaf报出的,而我们使用的是JSP作为视图文件,所以产生了视图模板冲突,导致解析错误。
解决办法:
1.使用JSP,删除thymeleaf的依赖
2.弃用JSP,使用thymeleaf作为视图文件
//使用JSP时,视图模板冲突,注释掉thymeleaf依赖解决问题
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>-->
本文介绍了如何解决Spring Boot项目中Thymeleaf与JSP视图模板冲突的问题,提供了两种解决方案:一是删除Thymeleaf依赖以使用纯JSP;二是完全切换到Thymeleaf。

2853

被折叠的 条评论
为什么被折叠?



