level 6
img/a/b/c. jpg 这种路径怎么写路径参数?
img/{img_path}大括号里怎么写?
2016年03月04日 13点03分
1
level 6
你们没明白我的意思,我是要一个url参数代表“img/”后边的所有链接。
没找到方法,最后做了如下处理:
@RequestMapping( value="/file_attach/file/**", method=RequestMethod.GET)
public ResponseEntity<byte[]> getFileRes(HttpServletRequest request) throws IOException {
//从请求url中获得文件路径(截掉开头的"/file_attach/file/"从第18个字符开始截取)
String filePath= request.getServletPath().substring(18);
2016年11月21日 12点11分
4