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){
    ...
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.