Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails/Spring对象的数据绑定映射_Spring_Grails_Data Binding - Fatal编程技术网

Grails/Spring对象的数据绑定映射

Grails/Spring对象的数据绑定映射,spring,grails,data-binding,Spring,Grails,Data Binding,我在绑定到具有对象映射的命令对象时遇到问题。这是我的命令对象: class SaveEntries { Map<Integer, EntryRow> entryRows = new HashMap<Integer, EntryRow>() String name } class EntryRow { int systemID def hours = ["","","","","","",""] } 这是我的表格: <form ac

我在绑定到具有对象映射的命令对象时遇到问题。这是我的命令对象:

class SaveEntries {
    Map<Integer, EntryRow> entryRows = new HashMap<Integer, EntryRow>()
    String name
}

class EntryRow {
    int systemID
    def hours = ["","","","","","",""]
}
这是我的表格:

<form action="main/save">
    <input type="text" name="name" value="test"/>
    <input type="text" name="entryRows[0].systemID" value="1"/>
    <input type="text" name="entryRows[0].hours[0]" value="5"/>
    <input type="submit"/>
</form>
如您所见,entryRows映射没有填充任何内容。如果我使用name=“entryRows['test']value=“test”,我可以得到一个要填充的映射,但是一旦我尝试使用一个对象作为键,数据绑定就会失败


有人知道我哪里出错了吗?谢谢!

您使用的是哪个版本的grails?我使用的是2.3.6版
<form action="main/save">
    <input type="text" name="name" value="test"/>
    <input type="text" name="entryRows[0].systemID" value="1"/>
    <input type="text" name="entryRows[0].hours[0]" value="5"/>
    <input type="submit"/>
</form>
[entryRows[0].systemID:[1], name:[test], entryRows[0].hours[0]:[5]]
[entryRows[0].systemID:1, entryRows[0]:[systemID:1, hours[0]:5], name:test, entryRows[0].hours[0]:5, action:save, format:null, controller:main]
test