基於spring的模擬ant路徑匹配url-pattern

public static void main(String[] args) {
   PathMatcher matcher = new AntPathMatcher();
   String requestPath="/w/user/1/post";
   String patternPath="/w/user/?/post";

   boolean result = matcher.match(patternPath, requestPath);

   System.out.println(result);

}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章