开发者

Spring intercept-url patterns

开发者 https://www.devze.com 2023-02-16 03:28 出处:网络
what is the difference between a Spring Security intercept-url pattern with path/** or path/* I\'ve seen some Spring security config开发者_如何学Curations that have the below, but I don\'t understand

what is the difference between a Spring Security intercept-url pattern with path/** or path/* I've seen some Spring security config开发者_如何学Curations that have the below, but I don't understand the /* vs /**


The /** vs. /* is a pretty common thing in frameworks nowadays, and is generally referred to as Apache Ant Pathing or something similar. Basically, the difference between the 2 is that /** matches the entire directory tree, including subdirectories, where as /* only matches at the level it's specified at.

For example, suppose you had the following files

Main.java
directory/Main.java

Then

/*.java

Would match Main.java, but not directory/Main.java, whereas

/**/*.java

would match both.

Obviously the principles applies exactly the same for urls in Spring Security, just seemed to a bit easier to illustrate it via file names in this case.

0

精彩评论

暂无评论...
验证码 换一张
取 消