使用@RequestParam及 list 或 array 接收GET请求的数组参数
Get请求:
http://192.168.1.10/falpolicy/supportDevices?deviceUuids=1&deviceUuids=2
使用List接收:
@RequestMapping(value = "/supportDevices", method = { RequestMethod.GET }, produces = { "application/json" }) public JsonWrapper getSupportDevices(@RequestParam List<String> deviceUuids) { return new JsonWrapper(null); }
使用String[]接收:
@RequestMapping(value = "/supportDevices", method = { RequestMethod.GET }, produces = { "application/json" }) public JsonWrapper getSupportDevices(@RequestParam String[] deviceUuids) { return new JsonWrapper(null); }