好用的路径匹配

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

简单了解一下用法

posted @ 2023-08-15 10:55  搬运工001  阅读(7)  评论(0)    收藏  举报