方法一:

application.yml

1
2
3
4
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher

或者在application.properties写

1
spring.mvc.pathmatch.matching-strategy=ant_path_matcher

方法二:
在启动类Application加上

1
2
3
4
5
6
@Bean
HttpFirewall httpFirewall() {
StrictHttpFirewall firewall = new StrictHttpFirewall();
firewall.setAllowUrlEncodedDoubleSlash(true);
return firewall;
}

原因很简单,Spring Boot干掉了双斜杠。


本站由 Natuie 使用 Stellar 1.29.1 主题创建。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。

今日总访问量: --次 | 本站总访问量: --次 | 本站总访客数: --人次
载入天数...载入时分秒...