scala code causes error in eclipse for playframewo

2019-04-27 14:17发布

问题:

I am trying out the todolist tutorial of playframework-2.0 on eclipse.I eclipsified the code and imported it sothat eclipse(helios) can detect the play api properly.I am however having trouble with the scala part

I updated eclipse to get the scala ide plugin .Still eclipse shows error markers next to

return ok(views.html.index.render(Task.all(),taskForm));

The error popup box shows views.html.index cannot be resolved to a type

Any idea how to resolve this?

回答1:

Have a look at the Setup and use Play framework in Scala IDE tutorial. For any trouble, bug us on the scala-ide-user ML.



回答2:

In my case the solution was to add the /target/scala-2.10/src_managed/main folder to the classpath.



回答3:

I was able to get rid of this warning by eclipsifying the project again

play eclipse

or

activator eclipse # If you use activator