url参数怎么匹配例如这样的路径?img/a/b/c.jpg
springmvc吧
全部回复
仅看楼主
level 6
客人画册 楼主
img/a/b/c. jpg 这种路径怎么写路径参数?
img/{img_path}大括号里怎么写?
2016年03月04日 13点03分 1
level 8
img/{$}/{$}/{$}.jpg
2016年11月17日 05点11分 3
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
1