Thymeleaf整合security

Thymeleaf整合security

1.使用高版本SpringBoot sec 不生效

原因:Thymeleaf、security、thymeleaf-extras-springsecurity 版本不相容,高版本SpringBoot默认Security版本已经为5.*

导入的thymeleaf-extras-springsecurity版本应该也为5。对应版本详见thymeleaf-extras-springsecuritygithup主页

修改页面引入为。

<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

2.更换高版本后sec标签报错

原因:注意标签是否正确

posted @ 2021-02-22 20:33  Apoint  阅读(140)  评论(0)    收藏  举报