1.前台通过ajax传输数据
var allFilePaths = new Array();
for (var i = 0; i < 10; i++) {
allFilePaths.push("xx"+i);
}
$.ajax({
url : url,
type : 'POST',
dataType: 'json',
contentType: "application/json",
data : JSON.stringify(allFilePaths),
success : function(col) {
}
},
error : function(col){
}
});
2.controller层
@RequestMapping("/delFileInfo")
@ResponseBody
public void delFileInfo(@RequestBody List<String> macroPath) throws IOException
{
for(String sPath :macroPath)
{
System.out.println(sPath);
}
}