导入依赖
导入Shiro框架需要的依赖:
shiro-core-1.3.2.jar
shiro-ehcache-1.3.2.jar
shiro-quartz-1.3.2.jar
shiro-spring-1.3.2.jar
shiro-web-1.3.2.jar
环境配置
1.在web.xml中配置Shiro的过滤器
与Spring集成:
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<async-supported>true</async-supported>
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
作者:TyCoding
链接:https://www.jianshu.com/p/984ac86f5fc9
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。