Shiro整合spring
本讲主要内容:
1:shiro整合spring、mybatis
官方地址:http://shiro.apache.org/spring.html
一:创建maven的web项目
将shiro整合spring、mybatis的思路
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:开发
项目结构如下: