我试图将一组对象绑定到我的Grails命令对象,但是目前它没有处理抛出错误:
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)]>
我的Grails应用程序中有以下命令对象:
class NewPersonCommand {
String name
Set<Address> addresses
}
我发布的表格代码如下:
<input type="hidden" name="addresses" value="1" />
<input type="hidden" name="addresses" value="4" />
<input type="hidden" name="addresses" value="18" />
我知道如何解决这个问题,所以我可以将我的地址集绑定到命令对象吗?