当我尝试编译我的播放应用程序时,我收到以下错误。请任何人帮我修复此错误..
[info] Compiling 4 Scala sources and 3 Java sources to /home/decathlon/play/samples/java/myApp/target/scala-2.10/classes...
[error] /home/decathlon/play/samples/java/myApp/app/views/index.scala.html:0: value Context is not a member of object play.mvc.Http
[error] /home/decathlon/play/samples/java/myApp/app/views/main.scala.html:0: value Context is not a member of object play.mvc.Http
[error] two errors found
[error] (compile:compile) Compilation failed
[error] Total time: 1 s, completed 11 May, 2014 9:24:02 PM
答案 0 :(得分:1)
按照主模板
中的模板参数@(content: Html)
进行操作
在索引模板中你应该有类似这样的东西
@main() {
<div>..</div>
}
在控制器中就像这样
public static Result index() {
return ok(
index.render()
);
}