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)
….
Caused by: java.lang.NoClassDefFoundError: org/thymeleaf/resourceresolver/IResourceResolver
有关如何使其工作的任何想法?
基本上,我有预先构建的HTML模板,它们并不真正符合XHTML标准,我想在Thymeleaf中使用它. Thymeleaf 2不支持HTML,甚至LEGACYHTML5模式因角度标记而引发错误
所以,我坚持使用只使用Thyme2而不支持Thyme3的Spring Boot,但我的应用程序只适用于Thyme3
解决方法
更新:从1.4开始,Spring Boot支持Thymeleaf 3但版本2仍然是默认值.有关如何使用Thymeleaf 3的详细信息,请参阅
the documentation.
Spring Boot 1.3及更早版本不支持Thymeleaf 3.您需要为Thymeleaf禁用Boot的自动配置并手动配置它.您可以使用exclude
attribute on @SpringBootApplication
禁用自动配置:
@SpringBootApplication(exclude=org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration.class)