I'm trying to bind a Set of objects to my Grails Command Objects, but currently, it doesn't work an throws errors:
Field error in object 'NewPersonCommand' on field 'addresses': rejected value [[Ljava.lang.String;@6d64b5fb]; codes [NewPersonCommand.addresses.typeMismatch.error,NewPersonCommand.addresses.typeMismatch,newPersonCommand.addresses.typeMismatch.error,newPersonCommand.addresses.typeMismatch,typeMismatch.NewPersonCommand.addresses,typeMismatch.addresses,typeMismatch.java.util.Set,typeMismatch]; arguments [addresses]; default message [Could not find matching constructor for: Address(java.lang.String)]>
I have the following command object in my Grails application:
class NewPersonCommand {
String name
Set<Address> addresses
}
And the code for the form I'm posting looks like this:
<input type="hidden" name="addresses" value="1" />
<input type="hidden" name="addresses" value="4" />
<input type="hidden" name="addresses" value="18" />
Any idea how I can fix this, so I can bind my set of addresses to the command object?