I want to create a REST-GET controller in spring-mvc
that takes a list of objects, eg 10 ids as follows:
@RestController
public class MyRest {
@RequestMapping(method = RequestMethod.GET)
public Object test(@RequestParam value="id" required=false) List<Integer> ids) {
Sysout(ids);
}
}
Anyway when I call it, I have to repeat the id param multiple times:
localhost:8080/app?id=1&id=2&id=3&...
It is possible to change the param to some kind of list? Eg
app?id=1,2,3,4,5
And if yes, is this advisable? What's better from the client point of view?