2021
02-24
02-24
解决@PathVariable对于特殊字符截断的问题
概述:@ResponseBody@RequestMapping(value="/download/{fileName:[a-zA-Z0-9\\.\\-\\_]+}",method=RequestMethod.GET)publicvoiddownloadAmr(HttpServletRequestrequest,HttpServletResponseresponse,@PathVariable("fileName")StringfileName){response.setContentType("application/octet-stream");Stringdir=System.getProperty("catalina.home");//获得tomcat所在的工作路径System.out.println("tomca...
继续阅读 >