Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.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/5/ember.js/4.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
thymeleaf和spring 3.0_Spring_Thymeleaf - Fatal编程技术网

thymeleaf和spring 3.0

thymeleaf和spring 3.0,spring,thymeleaf,Spring,Thymeleaf,我有一个表单,点击add按钮就会出现一个新行。如果再次单击“添加”按钮,则上一行下方会出现另一行,依此类推。 用户将在这些行中输入信息。 我的问题是如何将每行中新添加的信息的值传递给spring控制器。您的rows元素应命名为要绑定到控制器中列表对象中的列表。 例如: [...] 因此,当您添加新行时,只需增加地址索引 希望它能回答你的问题 <input type="text" name="address[0]" /> <input type="text" name="ad

我有一个表单,点击add按钮就会出现一个新行。如果再次单击“添加”按钮,则上一行下方会出现另一行,依此类推。 用户将在这些行中输入信息。
我的问题是如何将每行中新添加的信息的值传递给spring控制器。

您的rows元素应命名为要绑定到控制器中列表对象中的列表。 例如:


[...]
因此,当您添加新行时,只需增加地址索引

希望它能回答你的问题

<input type="text" name="address[0]" />
<input type="text" name="address[1]" />
[...]