Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 564
Raul Avatar asked Apr 18 '12 00:04

Raul


1 Answers

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.

like image 55
Eve Freeman Avatar answered Sep 18 '22 10:09

Eve Freeman