最近在学习spring-boot的时候,按照spring in action的第21章,搭建项目的时候,遇到了这个错误:

 java.lang.ClassNotFoundException: org.thymeleaf.spring5.ISpringTemplateEngine

检查发现,粗心引入了错误的依赖,正确的依赖是(我用的spring 5):

compile group: 'org.thymeleaf', name: 'thymeleaf-spring5', version: '3.0.9.RELEASE'

我引入的依赖是:


compile group: 'org.thymeleaf', name: 'thymeleaf', version: '3.0.9.RELEASE'

看书是还需要认真一点。

GitHub 加速计划 / sp / spring-boot
37
6
下载
spring-projects/spring-boot: 是一个用于简化Spring应用开发的框架。适合用于需要快速开发企业级Java应用的项目。特点是可以提供自动配置、独立运行和内置的Tomcat服务器,简化Spring应用的构建和部署。
最近提交(Master分支:16 天前 )
1cd14c96 Prior to this commit, Spring Boot would use Framework's `Jackson2ObjectMapperBuilder` to configure the `ObjectMapper` instance. This builder would configure the `ProblemDetail` mixin automatically. With the introduction of Jackson 3.x support, Spring Framework removed its builder in favor of the native Jackson builder. As a result, the mixin is not registered with the `JsonMapper` aymore. This commit ensures that the mixin is registered if the `ProblemDetail` class is present in the classpath. Closes gh-47298 2 小时前
51b606e9 - 3 小时前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐