Shiro内置过滤器
认证相关过滤器:
anon(不需要任何认证直接可以访问),authBasic(也就是httpBasic),authc(需要认证之后才可以访问),user(需要当前存在用户才可以访问),logout(退出)
授权相关的过滤器:
perms(后面跟[ ] 里面加参数,表示具备一些权限才可以访问),roles(与前者相似),ssl(要求是安全的协议才可以访问,比如https),port(后面跟[ ] 里面放端口,必须是指定端口的才可以访问)
(ps:ssl与port用的比较少)
测试一下以上部分过滤器:
@RequestMapping(value = "/testRole",method = RequestMethod.GET)
@ResponseBody
public String testRole(){
return "test Role success";
}
@RequestMapping(value = "/testRole1",method = RequestMethod.GET)
@ResponseBody
public String testRole1(){
return "test Role success";
}
@RequestMapping(value = "/testPerms",method = RequestMethod.GET)
@ResponseBody
public String testPerms(){ </