我正在呈现一个SignUp表单。下面是我的Register.java和SignUp.java的代码
controllers / Register.java:
package controllers;
import models.SignUp;
import play.mvc.*;
import play.data.Form;
public class Register extends Controller{
final static Form<SignUp> signupform = form(SignUp.class);
public Result index(){
return ok(index.render(signupform));
}
public Result submit(){
Form<SignUp> filledform = signupform.bindFromRequest();
SignUp details = filledform.get();
return ok("validated");
}
}
models / Signup.java:
package models;
public class SignUp{
public String firstName;
public String lastName;
public String emailId;
public String password;
public String address;
}
但是我收到以下错误:
cannot find symbol
symbol: method form(java.lang.Class<models.SignUp>)
location: class controllers.Register
有人可以帮助我找出为什么尽管导入了play.data.Form仍然出现上述错误。
谢谢。
答案 0 :(得分:0)