作者tony21177 ()
看板java
标题Re: [问题] 关於Spring trailing slash问题
时间Wed Nov 22 23:02:51 2017
在5.0.1.Release版的Spring Framework Documentation
提到要关掉traling slash的设定可以在configure override
public void configurePathMatch(PathMatchConfigurer configurer)
如下
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer
.setUseSuffixPatternMatch(false)
.setUseTrailingSlashMatch(false)
}
我试过後是可以成功关掉default设定
只是不知道为什麽使用RequestMappingHandlerMapping Bean去设定的方式会没有效果?
有办法知道Spring是否真的有拿我create的bean去mapping Handler吗?
可参考
1.4.2. Request Mapping的Pattern comparison
https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-requestmapping
1.11.12. Path Matching
https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-config-path-matching
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 220.135.236.53
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/java/M.1511362974.A.CBD.html
※ 编辑: tony21177 (220.135.236.53), 11/22/2017 23:08:27