好用的路径匹配

代码搬运工 / 2023-08-15 / 原文

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

简单了解一下用法