我正在尝试显示带有值的表单,但它不起作用。
我的行动:
public static Result login() {
User user = new User();
user.name = "Murilo";
Form<User> userForm = form(User.class);
return ok(login.render(userForm.fill(user)));
}
和我的html:
@(myForm : play.data.Form[models.User])
<!DOCTYPE html>
<html>
<head>
</head>
<body>
@helper.inputText(myForm("name"))
</body>
</html>
但是当我访问它时,会抛出以下错误:
type mismatch; found : play.data.Form.Field required: play.api.data.Field