user3625858
user3625858

Reputation: 21

"value Context is not a member of object play.mvc.Http" in play application

I am getting this following error when i am trying to compile my play application. Please anyone help me to fix this error..

    [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

Upvotes: 2

Views: 660

Answers (1)

myborobudur
myborobudur

Reputation: 4435

Follow the template parameter @(content: Html) in your main template

In the index template you should have something like this

@main() {
    <div>..</div>
}

and in the controller something like this

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

Upvotes: 1

Related Questions