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

How to accept mulitple REST query parameters with same id in 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);
  }
}

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

一起工作