When @RequestParam Collection<T> is used, the DelimitedStringToCollectionConverter class is in the ConverterRegistry to convert the delimited string to a collection object.
?id=1,2 --> List<String> with size = 2 and value as [ "1", "2" ].
When @RequestParam MultiValueMap<T, T> is used, the delimited string was not handled.
?id=1,2 --> map.get("id") --> List<String> with size = 1 and value as [ "1,2" ].
Is this intended?
Comment From: rstoyanchev
The main difference is that with a Collection<T>> there is an explicit request to turn one param value into a collection. In theMultiValueMap` case the intent is less clear since it is simply a holder for query parameters with multiple values.
The DelimitedStringToCollectionConverter has always caused a fair amount of surprise, if you see #23820 and related tickets. I personally don't like that default behavior but it's late to change without causing more surprise. At least there is a straight-forward way to override that behavior.