Thymeleaf 3.0 Spring Boot + Security integration does not work

前端 未结 3 732
执念已碎
执念已碎 2021-01-18 13:19

I struggle to get Thymeleaf to work with Spring Security in my Spring Boot 1.4.3 based project.

Tags like e.g.

3条回答
  •  [愿得一人]
    2021-01-18 13:40

    To get it working, if you are using Thymeleaf 3.0.2 with Spring Boot 1.4, you need to force version 3.0.1.RELEASE of thymeleaf-extras-springsecurity4 (because it inherits version 2.1.2 which does not work in combination with Thymeleaf 3):

    
        org.thymeleaf.extras
        thymeleaf-extras-springsecurity4
        3.0.1.RELEASE
    
    

    The tags should be using the hasRole function.

提交回复
热议问题