導入依賴
導入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
來源:簡書
著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。