感谢您阅读我的问题。
如何使用表单数组的响应?
请阅读 printSystem.scala.html
public class Test extends Controller {
static int form_max_length = 100;
static Form<Torque> torqueForm;
static Torque[] torque = new Torque[form_max_length];
static int checkData = 0;
public static Result completeData() {
torqueForm = form(Torque.class).bindFromRequest();
for (int checkData=0; checkData<form_max_length; checkData++) {
if (torque[checkData] != null) {
checkData++;
} else {
torque[checkData] = torqueForm.get();
torque[checkData].save();
break;
}
}
return TODO;
}
public static Result printData() {
return ok(printSystem.render(torqueForm));
}
}
扭矩系统.scala.html
@main("") {
<form action="/test" method="POST">
<div>
<label> Title </label>
<input type="text" name="title">
</div>
<div>
<label> Contents </label>
<input type="text" name="contents">
</div>
<div>
<input type="submit" value="submit">
</div>
</form>
}
printSystem.scala.html
@(形式:形式[扭矩]) 主要的(””) { @form.field("id").value() @form.field("title").value() @form.field("内容").value() }
请帮我。