javaspringspring-mvcpropertyeditorpath-variables

@PathVariable List<UUID> in Spring MVC


In a Spring MVC controller a @PathVariable Long... ids get resolved fine when passed input like 1,2,3.

If the parameter is declared as @PathVariable UUID... ids then the comma-separation doesn't work: a 400 response is returned.

Can I implement a custom PropertyEditor to handle UUID[] or List<UUID>? The only examples I can find are for single values, not collections/arrays.

UPDATE

As per Phil Webb's answer below, after reporting the issue as a bug on the Spring JIRA, the kind folks at SpringSource added support for this in Spring 3.2


Solution

  • This issue will be fixed in Spring 3.2. See https://jira.springsource.org/browse/SPR-9765 for details.