Spring与Shiro整合源码分析
Spring与Shiro整合是通过在web.xml里面配置过滤器: <filter> <filter-name>shiroFilter</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <init-param> <param-name>targetFileterLifecycle</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>shiroFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> 然后我们在apllicationContext.xml里面配置如下的ShiroFilterFactoryBean就可以了 <!-- Shiro 的Web过滤器 -->