第一种情况是jsp页面中
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
第二种情况是在html页面中引入
1.pom.xml文件中:
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>1.2.1</version>
</dependency>
2.在Configuration配置类里面:
@Bean
public ShiroDialect shiroDialect() {
return new ShiroDialect();
}
3.页面
<html xmlns:th="http://www.thymeleaf.org"
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" >