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

看板java作者時間7年前 (2017/11/22 23:02), 7年前編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
在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
文章代碼(AID): #1Q5P6Uoz (java)
文章代碼(AID): #1Q5P6Uoz (java)