首页 > 技术文章 > shiro 配置注解后无权访问不进行页面跳转异常:org.apache.shiro.authz.UnauthorizedException: Subject does not have permission

bg7c 2017-12-25 09:04 原文

该问题需要使用异常管理:

 

 

<!-- 无权访问跳转的页面 -->
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
  <property name="exceptionMappings">
    <props>
      <prop key="org.apache.shiro.authz.UnauthorizedException">refuse</prop>
    </props>
  </property>
</bean>

推荐阅读