Raul
Raul

Reputation: 299

Can I use groovy templating instead of scala for Play 2.0 based Java applications?

I am new Play 2.0, I am having hard time understanding scala templating for creating views. Can I switch back to groovy as it existed in earlier versions of Play framework. for e.g: Play 1.2, Play 1.2.4

Upvotes: 6

Views: 1005

Answers (1)

Eve Freeman
Eve Freeman

Reputation: 33165

Yes, there is a module available for groovy: https://github.com/manuelbernhardt/play2-groovy-templates

I've found the Scala templates not too bad to work with after a week of playing with them--especially if you're using Scala on the controller part. You might consider sticking it out for the learning curve.

Adding for the comments:

object ApplicationBuild extends Build {

...

    val appDependencies = Seq(
      "eu.delving" %% "groovy-templates-plugin" % "1.1"
    )

    val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
      resolvers += "Delving Snapshot Repository" at "http://development.delving.org:8081/nexus/content/repositories/snapshots",
      resolvers += "Delving Releases Repository" at "http://development.delving.org:8081/nexus/content/groups/public"
    )

}

Worked for me.

Upvotes: 8

Related Questions