<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="myrealm" class="com.ss.shiro.realm.MyRealm"></bean>
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="authenticator" ref="modelAuthricator" />
<property name="cacheManager" ref="cacheManager"/>
<property name="realms">
<list>
<ref bean="myrealm"/>
</list>
</property>
</bean>
<bean id="modelAuthricator" class="org.apache.shiro.authc.pam.ModularRealmAuthenticator">
<property name="authenticationStrategy" ref="firstSuccess"/>
<property name="realms">
<list>
<ref bean="myrealm"/>
</list>
</property>
</bean>
<bean id="firstSuccess" class="org.apache.shiro.authc.pam.FirstSuccessfulStrategy"/>
<!--缓存管理-->
<bean id="cacheManager" class="org.apache.shiro.cache.MemoryConstrainedCacheManager"/>
<!-- 将shiro与spring集合 -->
<bean id="shiroSecurityFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<!--<property name="filters">-->
<!--<map>-->
<!--<entry key="captchaAuthc" value-ref="captchaAuthenticationFilter" />-->
<!--<entry key="kickout" value-ref="kickoutSessionControlFilter" />-->
<!--<entry key="noaccess" value-ref="noAccessControlFilter"/>-->
<!--<entry key="pmlogout" value-ref="pmLogoutFilter"/>-->
<!--<entry key="authc" value-ref="pmAuthcFilter"/>-->
<!--</map>-->
<!--</property>-->
<!-- shiro的核心安全接口 -->
<property name="securityManager" ref="securityManager" />
<property name="loginUrl" value="/login" />
<property name="successUrl" value="/index" />
<property name="unauthorizedUrl" value="/unauthorized" />
<!-- shiro连接约束配置,在这里使用自定义的动态获取资源类 -->
<!--<property name="filterChainDefinitionMap" ref="chainDefinitionSectionMetaSource" />-->
<property name="filterChainDefinitions">
<value>
/login = anon
/hello = anon
/** = authc
</value>
</property>
</bean>
求大神指教 谢谢