Use RESTful URLs. However, when processing URLs with dots, the background cannot get them correctly, such as the URL localhost:8080/file/1234.jpg. The background only gets 1234, but the .jpg suffix is not available. Reason: Spring regards the dot as an extended separator, equivalent to /, so it cannot be obtained.
solution:
The matching pattern of /{path:.+} can be used in RequestMapping to get it correctly ( path is the parameter name), and so on in other cases
E.g:
@RequestMapping(value = "getFile/{folder}/{fileName:.+}*", method = RequestMethod.GET) public void getFile(HttpServletResponse response, @PathVariable String folder, @PathVariable String fileName) { }