好用的路径匹配

发布时间 2023-08-15 11:03:47作者: 搬运工001
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

简单了解一下用法