Thymeleaf 3 Beta的春季靴子

Gan*_*nan 3 spring spring-mvc angularjs thymeleaf spring-boot

Thymeleaf 3 beta的弹簧启动似乎不太好.

java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.security.FallbackWebSecurityAutoConfiguration due to internal class not found. 

This can happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) 
Run Code Online (Sandbox Code Playgroud)

....

 Caused by: java.lang.NoClassDefFoundError: org/thymeleaf/resourceresolver/IResourceResolver
Run Code Online (Sandbox Code Playgroud)

有关如何使其工作的任何想法?

基本上,我有预先构建的HTML模板,它们并不真正符合XHTML标准,我想在Thymeleaf中使用它.Thymeleaf 2不支持HTML,甚至LEGACYHTML5模式因角度标记而引发错误

所以,我坚持使用只使用Thyme2而不支持Thyme3的Spring Boot,但我的应用程序只适用于Thyme3

Tim*_*sen 8

这是正确的答案.这是要排除的类,以便让下一个人更容易解决此问题:

@SpringBootApplication(exclude={org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration.class})
Run Code Online (Sandbox Code Playgroud)

  • 没有手动配置.你只是忽略了Spring Boot对Thymeleaf的自动配置.我成功地排除了自动配置并使用迁移文档实现了基于Java的配置:http://www.thymeleaf.org/doc/articles/thymeleaf3migration.html (2认同)