的脚本Array
,int
我希望传入Spring Controller
. 但我不断得到
400 bad request.
如果我js array
是
array = [1,2,3,4]
array -> 400 bad request
JSON.Stringify(array) -> I will get [1,2,3,4]
$.ajax({//jquery ajax
data:{"images": array},
dataType:'json',
type:"post",
url:"hellomotto"
....
})
当我循环string List
..第一个元素将是'[1'
@RequestMapping(value = "/hellomotto", method = Request.POST)
public void hellomotto(@RequestParam("images") List<String> images){
sysout(images); -> I will get [1,2,3,4]
}
公共空白
我可以知道如何正确执行此操作吗?我尝试了不同的组合