Shrio : This subject is anonymous - it does not have any identifying principals and

                  使用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。并返回错误页面


    
	
                error/403
                error/403
                error/500
        
    

 

 

 

 

 

 

 

你可能感兴趣的:(Java)