码迷,mamicode.com
首页 > 其他好文 > 详细

Shiro内置过滤器

时间:2019-11-01 22:10:29      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:his   xtend   method   enum   form   pac   res   use   过滤器   

Shiro内置过滤器

DefaultFilter 枚举类定义了shiro所有的默认过滤器。

package org.apache.shiro.web.filter.mgt;
public enum DefaultFilter {

    anon(AnonymousFilter.class),
    authc(FormAuthenticationFilter.class),
    authcBasic(BasicHttpAuthenticationFilter.class),
    logout(LogoutFilter.class),
    noSessionCreation(NoSessionCreationFilter.class),
    perms(PermissionsAuthorizationFilter.class),
    port(PortFilter.class),
    rest(HttpMethodPermissionFilter.class),
    roles(RolesAuthorizationFilter.class),
    ssl(SslFilter.class),
    user(UserFilter.class);

    private final Class<? extends Filter> filterClass;

    private DefaultFilter(Class<? extends Filter> filterClass) {
        this.filterClass = filterClass;
    }
}

打印枚举类:

public static void main(String[] args) {
    for(DefaultFilter filter :DefaultFilter.values()){
        System.out.println(filter.name() + ":" + filter.getFilterClass().getName());
    }
}
anon:org.apache.shiro.web.filter.authc.AnonymousFilter
authc:org.apache.shiro.web.filter.authc.FormAuthenticationFilter
authcBasic:org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter
logout:org.apache.shiro.web.filter.authc.LogoutFilter
noSessionCreation:org.apache.shiro.web.filter.session.NoSessionCreationFilter
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

Shiro内置过滤器

标签:his   xtend   method   enum   form   pac   res   use   过滤器   

原文地址:https://www.cnblogs.com/mozq/p/11779793.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!