zl程序教程

您现在的位置是:首页 >  Java

当前栏目

shiro中的过滤器

2023-02-18 16:35:55 时间
  • shiro框架内置了10个过滤器
  • 常见的如下
    • anon :有的资源(页面和方法)不登录也可以访问,那么这些资源我们可以配置成anon过滤器
    • authc:有的资源必须登录后才能访问,那么这些资源我们可以配置成authc过滤器
    • perms[“添加文章”] :这个资源必须当前登录人有“企业管理”权限才能访问

过滤器简称

相对应的java类

anon

org.apache.shiro.web.filter.authc.AnonymousFilter

authc

org.apache.shiro.web.filter.authc.FormAuthenticationFilter

authcBasic

org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter

perms

org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter

port

org.apache.shiro.web.filter.authz.PortFilter

rest

org.apache.shiro.web.filter.authz.HttpMethodPermissionFilter

roles

org.apache.shiro.web.filter.authz.RolesAuthorizationFilter

ssl

org.apache.shiro.web.filter.authz.SslFilter

user

org.apache.shiro.web.filter.authc.UserFilter

logout

org.apache.shiro.web.filter.authc.LogoutFilter