之前在弄Spring Security,在页面文件中增加sec标签来进行权限等控制。如:sec:authorize="isAuthenticated().
但发现标签无效,网上查了一些说明,说是需要修改pom.xml文件,添加properties,或着降低版本。
我用的springboot/Security 都是比较新的2.3.1和thymeleaf-extras-springsecurity4不太愿意去降低版本.毕竟用新的版本才能发现问题么.后面在Maven搜了下有thymeleaf-extras-springsecurity5,果断升级,问题解决.
简而言之,如果你用的springboot/Security是2.3,那你就用thymeleaf-extras-springsecurity5.
注意,在html页面中 xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"