本文主要是介绍apache spring @RequiresRoles 不起作用,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
apache spring @RequiresRoles 不起作用,只需要把下面代码添加到spring-mvc 配置文件中
<!-- Support Shiro Annotation --><bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> <property name="exceptionMappings"> <props> <prop key="org.apache.shiro.authz.UnauthorizedException">/static/403.html</prop></props> </property> </bean><bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/><!-- Enable Shiro Annotations for Spring-configured beans. Only run afterthe lifecycleBeanProcessor has run: --><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>
这篇关于apache spring @RequiresRoles 不起作用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!