<bean id="myShiroRealm" class="com.shiro.test.mvc.filter.MyShiroRealm"/>
<bean id="cacheManager" class="org.apache.shiro.cache.MemoryConstrainedCacheManager"/>
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="myShiroRealm"/>
<property name="cacheManager" ref="cacheManager"/>
<property name="rememberMeManager" ref="rememberMeManager"/>
</bean>
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManager"/>
</bean>
<bean id="shiroFilter" class="com.shiro.test.mvc.filter.MyShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"/>
<property name="loginUrl" value="/gologin.html"/>
<property name="successUrl" value="/index.html"/>
<property name="unauthorizedUrl" value="/error.html"/>
<property name="filterChainDefinitions">
<value>
/login.html=anon
/gologin.html=anon
/index.html = authc
/side.html = authc
</value>
</property>
<property name="filters">
<map>
<entry key="roles">
<bean class="com.shiro.test.mvc.filter.MyShiroFilter"/>
</entry>
</map>
</property>
</bean>
Shiro框架项目总结
最新推荐文章于 2025-03-07 09:39:26 发布