您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

如何将Thymeleaf SpringSecurityDialect添加到Spring Boot

如何将Thymeleaf SpringSecurityDialect添加到Spring Boot

就像上面的仓库中的链接所示,这意味着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-springsecurity4thymeleaf.version与其他答案中建议的相同。

Java 2022/1/1 18:18:54 有611人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶