SpringSecurity 与 Thymeleaf 整块无法响应 (新)

SpringBoot 版本更新以后很多模块发生了一些幅度的改动 如 原来的整合模块 SPRINGSECURITY4 SPRINGSECURITY5在新的版本中用以前的html

xmlns:sec="http://www.thymeleaf.org/extras/spring-security4"
或者
xmlns:sec="http://www.thymeleaf.org/extras/spring-security5"

已经是不在能用

进入pom文件 查看parent 中的springbootdependencies


<thymeleaf-extras-springsecurity.version>3.0.4.RELEASE</thymeleaf-extras-springsecurity.version>

发现官方已经改名了 从<thymeleaf-extras-springsecurity4.version> 或者 <thymeleaf-extras-springsecurity5.version> 已经变成了 <thymeleaf-extras-springsecurity.version> 不存在4或5版本一说了

那我们导入依赖 thymeleaf和springsecurity的整合依赖 然后 html中 引入

 xmlns:sec="http://www.thymeleaf.org/extras/spring-security" 

就ok了

原文地址:https://www.cnblogs.com/nineberg/p/12468577.html