application.yml 或applicaiton.properties 中添加如下配置 spring: mvc: pathmatch: matching-strategy: ant_path_matcher