3
我下载并安装了play framework 2.0.2,然后创建了一个项目。我越过了这个项目并在日食中打开它。渲染函数在播放框架2.0.2中不存在?
我有一个叫做Application的类,它扩展了Controller类。在网络上的大多数例子中,我看到如下的控制器。
public class Application extends Controller {
public static void index() {
render(arg0,arg1,...);
}
public static void tasks() {
render(arg0,arg1,...);
}
public static void newTask() {
render(arg0,arg1,...);
}
public static void deleteTask(Long id) {
render(arg0,arg1,...);
}
}
但是在我的默认应用程序中,我只能执行以下操作。我不知道如何做前一个。
public class Application extends Controller {
public static Result index() {
return ok("Hello World!");
}
public static Result tasks() {
return ok(indexabc.render("hello world"));
}
public static Result newTask() {
return TODO;
}
public static Result deleteTask(Long id) {
return TODO;
}
}
在我的代码中,当我尝试用“void”替换“Result”返回类型时,没有任何问题。但是,当我想用某些参数调用“render()”方法时,该方法不存在。我无法找到如何调用渲染函数的方法。
感谢您的回复 – 2012-07-18 14:59:00