0
我目前正在使用Play框架,但似乎没有什么关于表单的信息。玩框架和表格
在我得到的东西,看起来像这样的时刻: 的路线是:
GET /test controllers.Application.testMethod()
的方法:
public static Result testMethod(){
//handles the Form
}
的NameResidencePair类:
public static class NameResidencePair{
public String name;
public String residence;
}
斯卡拉.html以表格形式提供的网页
@(aForm: Form[NameResidencePair])
@import helper._
@form(action = routes.Application.testMethod) {
@inputText(
field = userForm("name")
)
@inputText(
field = userForm("residence")
)
}
如果我仍然想要一个表单,但是其中一个值(如居住地)始终是相同的值,该怎么办?例如:residence =“在云上”。我仍然想通过表单传递它,但我不想要一个文本框。换句话说,我想通过一个名称和居住形式,但只有名称应该是可编辑的,并在输入字段中可见。