Shrio : This subject is anonymous - it does not have any identifying principals and
来源:互联网 发布:淘宝商品资质怎么弄 编辑:程序博客网 时间:2024/05/16 07:46
使用shrio,集成到springmvc后,访问带有@RequirePermission注解的方法,This subject is anonymous - it does not have any identifying principals and authorization operations require an identity to check against. A Subject instance will acquire these identifying principals automatically after a successful login is performed ..
未登录的情况下,访问需要登陆后才能使用的链接回抛出如上异常。解决方法是,在springmvc.xml中添加全局异常捕获,捕获异常类:org.apache.shiro.authz.UnauthenticatedException。
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"><property name="exceptionMappings"><props><!-- 未登录验证异常 --><prop key="org.apache.shiro.authz.UnauthorizedException">error/403</prop><!-- 未授权使用的异常 -->
<prop key="org.apache.shiro.authz.UnauthenticatedException">error/403</prop><!-- 其他 -->
<prop key="java.lang.Throwable">error/500</prop>
</props>
</property>
</bean>
0 0
- Shrio : This subject is anonymous - it does not have any identifying principals and
- AWS S3对象无法下载——This XML file does not appear to have any style information associated with it
- any object does not have a member named generator
- Cannot find ./catalina.sh The file is absent or does not have execute permission This file is nee
- Cannot find ./catalina.sh The file is absent or does not have execute permission This file is nee
- Cannot find ./catalina.sh The file is absent or does not have execute permission This file is nee
- Clion this file does not belong to any project target
- Android 4.2 Feature Highlight: So, What Is This Miracast Thing And How Does It Work, Anyway?
- User <anonymous> does not have permission on weblogic.management.adminhome to perform lookup operati
- Storm运行出现Client is being closed, and does not take requests any more引起的Netty故障跟踪
- Scene is unreachable due to lack of entry points and does not have an identifier for runtime access
- Scene is unreachable due to lack of entry points and does not have an identifier for runtime access
- 警告: Scene is unreachable due to lack of entry points and does not have an identifier for runtime acc
- Scene is unreachable due to lack of entry points and does not have an identifier for runtime access
- Swift: 消除警告-Scene is unreachable due to lack of entry points and does not have an identifier for
- The file is absent or does not have execute permission
- zanotti shoes because Uganda does not have any well-trained "astronaut"
- [Java]The project 'XXX' does not have any GWT SDK's on its build path
- 将存放在首地址为buf、长度为3B数据,通过调用INT 21H的AH=02H子功能、以二进制的形式从屏幕输出。
- DevOps
- 第十二周项目三数据结构例程——图的遍历
- 第十三周项目四--Floyd
- 公司->保存 和验证
- Shrio : This subject is anonymous - it does not have any identifying principals and
- H264 ES PS TS 流的区别
- SDCC杭州站记录总结
- 修改itoa函数,使得该函数可以接受三个参数。其中第三个参数为最小字符宽度。
- jquery easyui datagrid
- OBD-II PIDs
- nux下取代top的进程管理工具 htop
- 【飞阅】XML中常用JS代码块
- 第十二周项目4 利用遍历思想求解图问题(4)