----------------------------導入了依賴<dependency><groupId>org.thymeleaf.extras</groupId><artifactId>thymeleaf-extras-springsecurity4</artifactId><version>3.0.2.RELEASE</version></dependency>----------------------------也引入了命名空間xmlns:th="http://www.thymeleaf.org"xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4前端和控制臺都沒有報錯,springboot版本2.1.0sec相關(guān)的標簽都能自動提示,但是使用都是無效的。sec:authorize="hasRole('ROLE_ROOT')"也無法控制顯示;無論什么值都會顯示div。
2 回答

慕粉4159764
TA貢獻1條經(jīng)驗 獲得超1個贊
<thymeleaf-layout-dialect.version>2.3.0</thymeleaf-layout-dialect.version> 在pom里面加上這個 layout版本要2.3.0
添加回答
舉報
0/150
提交
取消