Spring-Security: Difference Between /** and /* url pattern in Spring-Security

Harmeet Singh Taara picture Harmeet Singh Taara · Jul 25, 2014 · Viewed 21.9k times · Source

I am little bit confuse with URL-pattern in spring security. Because, in servlet core http security, the / and /* url patterns are used for specify one or more directories. / is use for one directory and /* is used of many directories. But in spring-security, the /** is also introduce, what is the main purpose of /** url-pattern in security.

Answer

Rahul Jain picture Rahul Jain · Jul 25, 2014

The difference between /* & /** is that the second matches the entire directory tree, including subdirectories, where as /* only matches at the level it's specified at.