在springboot2.0中需要注意一个问题,那就是shiro和thymeleaf的支持依赖需要使用2.0.0
1、添加依赖
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>2.0.0</version>
</dependency>
2、在ShiroConfig中配置ShiroDialect
/**
* shiro方言 支持shiro标签
* @return
*/
@Bean
public ShiroDialect shiroDialect() {
return new ShiroDialect();
}
3、html中导入shiro标签

本文介绍如何在SpringBoot 2.0中配置Shiro和Thymeleaf以实现权限管理和页面展示。具体步骤包括添加依赖、配置ShiroDialect及使用shiro标签。
2万+

被折叠的 条评论
为什么被折叠?



