我已下载Play 2.5并正在创建示例应用程序。我正在创建简单的表单。下面是代码。使用private static final Form<Product> productForm = Form.form(Product.class);
时出现运行时错误:
public class Products extends Controller {
private static final Form<Product> productForm = Form.form(Product.class);
public Result list(){
List<Product> products = Product.findAll();
return ok(list.render(products));
}
public Result newProduct(){
//return ok(details.render(productForm));
return TODO;
}
public Result details(String ean){
return TODO;
}
public Result save(){
return TODO;
}
}
错误消息是:
内部服务器错误,对于(GET)[/] - &gt; play.api.UnexpectedE xception:play.core.server.Dev上的意外异常[ExceptionI nInitializerError:null] ServerStart $$ anonfun $ mainDev $ 1 $$ anon $ 1 $$ anfun $ get $ 1 $$ anonfun $ apply $ 1 $$ anonfun $ 1.ap ply(DevServerStart.sc ala:174)