Re: [問題] 關於Spring trailing slash問題

作者: tony21177   2017-11-22 23:02:51
在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

Links booklink

Contact Us: admin [ a t ] ucptt.com