简体   繁体   中英

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 eg: Play 1.2, Play 1.2.4

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM