SpringBoot @PathVariable请求路径出现点号"."时导致路径参数截断获取不全的解决办法

阅读 61

2021-09-21

springboot使用@PathVariable路径参数,当请求路径中含有【.】符号,点符号后面的会被截断,解决方法如下:
解决办法:

  • 添加:.+在逗号分隔处;
 @GetMapping("video/{fileName:.+}")
public void video(@PathVariable(value = "fileName") String fileName, HttpServletResponse response) throws IOException {
      ......
}

欢迎关注南阁公众号

精彩评论(0)

0 0 举报