1. 添加依赖
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>
1.2.1
</version>
</dependency>
2. 在shiro的configuration中配置
@Bean
public ShiroDialect shiroDialect() {
return new ShiroDialect();
}
3. 在html中加入xmlns
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
xmlns:shiro="http://www