Re: [問題] 關於Spring trailing slash問題
在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://www.ptt.cc/bbs/java/M.1511362974.A.CBD.html
※ 編輯: tony21177 (220.135.236.53), 11/22/2017 23:08:27
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
java 近期熱門文章
PTT數位生活區 即時熱門文章