1.加入spring jar 包并配置 web.xml

spring依赖ja包
web.xml:

application.xml:

spring配置文件,空的
2.配置 springmvc

web.xml配置springmvc

springmvc配置文件
测试配置是否正确,新建jsp页面并访问验证
3.开始整合 shiro(添加 shiro jar包)

shiro依赖 jar
4.配置 shiro(参考shiro源码包)
参考 :shiro-root-1.3.2\samples\spring\src\main\webapp\WEB-INF目录下的
applicationContext.xml 和 web.xml两个文件
web.xml下添加(在参考代码里边找):

1.在 spring 中配置 shiro

2. 配置 CacheManager. 2.1 需要加入 ehcache 的 jar 包及配置文件.

2.配置 cacheManager(需要导入 jar和配置文件hibernate有ehcache-core.jar与ehcache.xml配置文件)

配置 ehcache
3. 配置 Realm 3.1 直接配置实现了 org.apache.shiro.realm.Realm 接口的 bean

创建ShiroRealm.java

4.配置 LifecycleBeanPostProcessor

5.启用 IOC 容器中使用 shiro 的注解

启用 IOC 容器中使用 shiro 的注解
6.配置 ShiroFilter(创建login.jsp等页面测试)
