2

still learning to master akka java with play framework. I have a code snippet below. It was working fine but has decided to give some headaches.

public class Application extends Controller {

static ActorRef masterActor;
  RubineActor rubineactor;


  public static Result index() {          
      return ok(index.render(null));
   ........ somecode
  }

it was working fine but now my eclipse juno complains that it cannot resolve the index object in the return line . I am new to both akka and play framework . Can someone please explain what is happening to me. cos have to submit the project as my final year project. thanks

Florent
  • 12,310
  • 10
  • 49
  • 58
faisal abdulai
  • 3,739
  • 8
  • 44
  • 66

1 Answers1

2

Your problem is not related to Akka, it's a template concern.

The variable index is provided by a template import, certainly import views.html.*; Eclipse sometimes cannot resolve this object because it is generated automatically by Play after the first request.

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.

See the hello word sample for a concrete exemple.

Community
  • 1
  • 1
Julien Lafont
  • 7,869
  • 2
  • 32
  • 52