Spring security application of antMatcher() vs. antMatchers()
问题 Just want to see whether I'm interpreting the answer to this question the right way. If we only need to secure one path like this: http.antMatcher("/api/**").authorizeRequests().... Then use antMatcher() . If we need to secure multiple URL paths like this: http .authorizeRequests() .antMatchers("/high_level_url_A/sub_level_1").hasRole('USER') .antMatchers("/high_level_url_A/sub_level_2").hasRole('USER2') ... Then use antMatchers() . There are two answers in this question, but the example