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)

1

1 Answer 1

5

You can map it to an array like so

public String getFile(@RequestParam(value="id") int[] ids){
    ...
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.