如何在spring-mvc中接受具有相同id的多个REST查询参数?

mem*_*und 2 java rest spring spring-mvc

如何spring-mvc使用具有相同名称的多个参数创建一个休息控制器?localhost:8080/api?id=12&id=15&id=88

//pseudocode
@RestController
public class MyRest {
   @RequestMapping(method = RequestMethod.GET)
   public Object test(@RequestParam value="ids" required=false) List<Integer> ids) {
    Sysout(ids);
  }
}
Run Code Online (Sandbox Code Playgroud)

Pre*_*ric 7

?id=12&id=15&id=88 应该自动工作 @RequestParam(value="id") List<Integer> ids