Spring Boot mvc path match strategy
Solution 1:
See the Spring Boot documentation:
As of Spring Framework 5.3, Spring MVC supports several implementation strategies for matching request paths to
Controller
handlers. It was previously only supporting theAntPathMatcher
strategy, but it now also offersPathPatternParser
. Spring Boot now provides a configuration property to choose and opt in the new strategy:
spring:
mvc:
pathmatch:
matching-strategy: "path-pattern-parser"
For more details on why you should consider this new implementation, see the dedicated blog post.