首页 > 其他分享 >好用的路径匹配

好用的路径匹配

时间:2023-08-15 11:15:22浏览次数:30  
标签:匹配 matcher 路径 System AntPathMatcher user 好用 match out

import org.springframework.util.AntPathMatcher;
    
public static void main(String[] args) {
        AntPathMatcher matcher = new AntPathMatcher();
        System.out.println(matcher.match("/user/**", "/user"));
        System.out.println(matcher.match("/user/**", "/user/1"));
        System.out.println(matcher.match("/user/**", "/user/1/2"));
    }
true
true
true

简单了解一下用法

标签:匹配,matcher,路径,System,AntPathMatcher,user,好用,match,out
From: https://www.cnblogs.com/xiaohuang001/p/17630750.html

相关文章