Shiro整合spring

本讲主要内容:

1:shiro整合springmybatis

官方地址:http://shiro.apache.org/spring.html

一:创建mavenweb项目

Shiro学习系列教程六:Shiro整合spring_配置文件



将shiro整合springmybatis的思路

0:在pom.xml文件中添加相关的jar

1:在web.xml中配置

shiro的过滤器shiro过滤器、

 spring的配置文件、

Spirng的监听器、

Spring mvc的支持、

2:在spring的配置文件中配置:

自动扫描的包(services层、dao)
数据源、

Mybatis相关的、

事务、

自定义Realm、

安全管理器、

Shiro过滤器、

Shiro内部执行的函数。

Shiro注解、

事务通知、

切面

3:spring-mvc配置文件

扫描的controller层、

视图解析器

4:mybatis配置文件

别名


5:开发

项目结构如下:



Shiro学习系列教程六:Shiro整合spring_mvc_02

Shiro学习系列教程六:Shiro整合spring_配置文件_03