springboot使用@PathVariable路徑參數(shù),當(dāng)請求路徑中含有【.】符號,點符號后面的會被截斷,解決方法如下:
解決辦法:
- 添加
:.+在逗號分隔處;
@GetMapping("video/{fileName:.+}")
public void video(@PathVariable(value = "fileName") String fileName, HttpServletResponse response) throws IOException {
......
}
歡迎關(guān)注南閣公眾號
南閣子也