1
我只能在java中找到示例,它们似乎都表明我正在做的事情应该“只是工作”。我有一个如下所示的表单(或者名称为“id”或“id []”),两者的结果相同。我试图将我的编辑方法声明为List [Int]或Seq [Int],但在两种情况下,id最终都是NULL。如果我转储参数,我可以看到实体包含正确的查询字符串,如果我只是做一个get(“id”)它返回作为包含第一个值(1)的int。我怎么能通过表单提交某种有序的容器(不关心它是一个列表或序列或其他什么)?通过POST在1.2.4中通过POST提交数组/列表/ seq使用scala 0.9.1
<form method="post" action="">
<input type="hidden" name="id" value="1" />
<input type="hidden" name="id" value="2" />
<input type="hidden" name="id" value="3" />
<input type="hidden" name="id" value="4" />
<input type="text" name="name" />
<input type="submit" />
</form>
def edit(id: List[Int]) = {...}