3

As you probably know, http supports repeated parameters, such as http://host/file?id=1&id=2.

In my case a Javascript element sends the ids of multiple rows in order for the server to do something with all these ids.

Is it possible for Spring MVC to give me all the ids as a collection? (List or Array)

flybywire
  • 261,858
  • 191
  • 397
  • 503
  • 1
    you can have a look on http://stackoverflow.com/questions/9768509/can-spring-mvc-handle-multivalue-query-parameter – Kidi May 01 '13 at 10:54

1 Answers1

5

You can map it to an array like so

public String getFile(@RequestParam(value="id") int[] ids){
    ...
}
James
  • 1,541
  • 12
  • 25