Playframework Play Framework 2.0-views.render引发异常
我正在尝试让hello world应用程序从运行 我得到以下错误:Playframework Play Framework 2.0-views.render引发异常,playframework,playframework-2.0,Playframework,Playframework 2.0,我正在尝试让hello world应用程序从运行 我得到以下错误: render(java.lang.String) in views.html.index cannot be applied to (play.data.Form<controllers.Application.Hello>) 此外,Eclipse无法解析索引对象上的.render方法 the method render(String) in the type index is not applicable for
render(java.lang.String) in views.html.index cannot be applied to (play.data.Form<controllers.Application.Hello>)
此外,Eclipse无法解析索引对象上的.render方法
the method render(String) in the type index is not applicable for the arguments (Form<Application.Hello>)
此外,app/views文件夹中还提供了hello.scala.html和index.scala.html/
知道我做错了什么吗?Play 2.0中的每个视图都是一个包含参数的Scala函数,最有可能的是在开始时声明的index.sacala.html字符串中:
@(message: String)
它应该是你的表格:
在控制器中:
final static Form<MyModel> myForm = form(MyModel.class);
public static Result blank() {
return ok(formNew.render(myForm));
}
@(message: String)
final static Form<MyModel> myForm = form(MyModel.class);
public static Result blank() {
return ok(formNew.render(myForm));
}
@(myForm: Form[MyModel])