0
當我修改其他開發人員編寫的代碼時,我遇到了一個終點@RequestMapping(value = "/ICD/{icdcode:.+}
,並且想知道路徑變量中的。+是什麼。什麼是字符串:。+在春季請求映射的路徑參數
當我修改其他開發人員編寫的代碼時,我遇到了一個終點@RequestMapping(value = "/ICD/{icdcode:.+}
,並且想知道路徑變量中的。+是什麼。什麼是字符串:。+在春季請求映射的路徑參數
這已經回答了
Spring MVC @PathVariable getting truncated
Spring MVC @PathVariable with dot (.) is getting truncated
Spring - Path variable truncate after dot - annotation
基本上,這是一個正則表達式。 Spring認爲最後一個點背後的任何東西都是一個擴展,並將其除掉。
如果你有一個映射/somepath/{email}
,並嘗試/somepath/[email protected]
的路徑參數email
值將是[email protected]
使用正則表達式{pathparam:+}一切價值的考慮一部分,甚至背後是什麼最後一個點。
感謝您的澄清。它會被回答,但是當我用關鍵詞完全搜索時,我沒有找到任何匹配的答案。 – arjun