仍在学习掌握 akka java 和 play 框架。我下面有一个代码片段。它运行良好,但决定带来一些麻烦。
public class Application extends Controller {
static ActorRef masterActor;
RubineActor rubineactor;
public static Result index() {
return ok(index.render(null));
........ somecode
}
它工作正常,但现在我的 eclipse juno 提示它无法解析返回行中的索引对象。我对 akka 和 play 框架都很陌生。有人可以解释一下我身上发生了什么事吗?因为必须将该项目作为我的最后一年项目提交。谢谢
最佳答案
你的问题与Akka无关,它是一个template concern 。
变量index
是由模板导入提供的,当然是importviews.html.*;
Eclipse 有时无法解析此对象,因为它是在第一个请求之后由 Play 自动生成的。
Templates are compiled as standard Scala functions, following a simple naming convention. If you create a views/Application/index.scala.html template file, it will generate a views.html.Application.index class that has a render() method.
请参阅hello word sample举一个具体的例子。
关于java - akka 与 play 框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11907130/