就像上面的仓库中的链接所示,这意味着org.thymeleaf.extras:thymeleaf-extras- springsecurity4
依赖org.thymeleaf:thymeleaf
。显然您没有提供此依赖性。教室IExpressionEnhancingDialect
在那里。您可以通过将依赖项添加到项目中来解决该问题。
因为这可能会变得有点复杂…我还在玩Spring Boot,spring security和thymeleaf的安全方言(以及带有h2的spring数据)。这是我的gradle依赖项以供参考,它们可能会以某种方式帮助您:
ext['thymeleaf.version'] = '3.0.1.RELEASE'
ext['thymeleaf-layout-dialect.version'] = '2.0.0'
dependencies {
compile("org.springframework.boot:spring-boot-devtools")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.thymeleaf.extras:thymeleaf-extras-springsecurity4:3.0.1.RELEASE")
compile("com.h2database:h2")
}
请注意,我想使用thymeleaf 3而不是2,这就是为什么我的配置中还有一些其他不愉快的调整的原因。
的版本thymeleaf-extras-springsecurity4
应thymeleaf.version
与其他答案中建议的相同。