shiro权限注解起作用配置

 <!-- 支持注解权限验证 -->

<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">  

   <property name="exceptionMappings">  

       <props>  

                  <!-- 无权限时提示页面 -->

           <prop key="org.apache.shiro.authz.UnauthorizedException">unauthorized</prop>

       </props>  

   </property>  

</bean>  

<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"  depends-on="lifecycleBeanPostProcessor"/>    

<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">

     <property name="securityManager" ref="securityManager"/>

</bean>

猜你喜欢

转载自greatpwx.iteye.com/blog/2214725