<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" 
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:cache="http://www.springframework.org/schema/cache"
	 xmlns:task="http://www.springframework.org/schema/task"
	xsi:schemaLocation="http://www.springframework.org/schema/beans  
		   http://www.springframework.org/schema/beans/spring-beans-4.3.xsd 
		   http://www.springframework.org/schema/mvc 
		   http://www.springframework.org/schema/mvc/spring-mvc.xsd	
		   http://www.springframework.org/schema/aop   
		   http://www.springframework.org/schema/aop/spring-aop-4.3.xsd  
		   http://www.springframework.org/schema/tx  
		   http://www.springframework.org/schema/tx/spring-tx-4.3.xsd  
		   http://www.springframework.org/schema/cache
		   http://www.springframework.org/schema/cache/spring-cache.xsd
		   http://www.springframework.org/schema/context  
		   http://www.springframework.org/schema/context/spring-context-4.3.xsd">
	
	<!--继承自AuthorizingRealm的自定义Realm 指定自定义relam
	<bean id="myRealm" class="org.fouram.common.shiro.MyRelam"/>-->
	<!-- 配置shiro Realm 设置单个Relam应用-->
	<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
	   <property name="realm" ref="ShiroRealm"/>
	</bean>
	<!-- 自定义,使用基于url路径表达式,进行权限控制 -->
	<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
		<!-- 配置security 属性 -->
		<property name="securityManager" ref="securityManager"/>
		<!-- 默认login 页面,默认为 webRoot根目录下-->
		<property name="loginUrl" value="/login_toLogin" />
		<!-- 登录成功后的页面 ,授权成功后跳转的页面,默认为登录controller的地址-->
		<property name="successUrl" value="/main/index" />
		<!-- 未授权时访问的界面 -->
		<property name="unauthorizedUrl" value="/noacess"></property>
		<!-- anon：它对应的过滤器里面是空的,什么都没做,这里.do和.jsp后面的*表示参数,比方说login.jsp?main这种 -->  
		<!-- authc：该过滤器下的页面必须验证后才能访问,它是Shiro内置的一个拦截器org.apache.shiro.web.filter.authc.FormAuthenticationFilter -->  
		<property name="filterChainDefinitions">  
			<value>  
				/public/** = anon
				/login_login = anon
				/login_toLogin = anon
				/home = anon
				/*/*login* = anon
				/*/*Login* = anon
				/*/*Anon = anon
				/API/* = anon
				/task/* = anon
				/** = authc
			</value>  
		</property>  
	</bean>
	<!-- 保证实现了shiro 内部的lifecyle 函数的bean执行 -->
	<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"></bean>
</beans>