Having this http://myserver/find-by-phones?phone=123&phone=345 request, is it possible to handle with something like this:
@Controller
public class Controller{
@RequestMapping("/find-by-phones")
public String find(List<String> phones){
...
}
}
Can Spring MVC some how convert multi-value param phones to a list of Strings (or other objects?
Thanks.
Alex
find(@RequestParam(required=false, value="phone") List<String> phones)should work. This works forurl?phone=123&phone=345and also forurl?phone=123,345and fornullparameter value likeurlorurl?phone=I hope this helps anyone looking for this solution :)