ripper234
ripper234

Reputation: 230138

How can you use groovy inside Play! Framework, outside of templates?

The FAQ states

Is play a Groovy framework?

No. Even if we use Groovy as the base technology for the Play templating system, it’s totally transparent. Also, you can’t write directly any other part of the application (such as controllers, models or other utilities) in Groovy. If you’re looking for a Groovy based framework you should have a look at Grails.

While I get that it's not supported out of the box, I do believe/hope the integration is possible ... I mean, Java is Turing Complete after all :)

So, has anyone experimented in writing Groovy code, and calling that code from Play! Controllers? What's the best way to achieve that?

Bonus points: If the solution worked seamlessly with IntelliJ, that would be heaven.

Upvotes: 0

Views: 2026

Answers (1)

i.am.michiel
i.am.michiel

Reputation: 10404

As said in the documentation, Play is not a Groovy framework. Is is plain java and I am not aware of any initiative of using Groovy in Play.

Plus, bonus point, Play2 has completly removed Groovy even in templates to be replaced by Scala. So I think that even if a solution exists it might not be maintained in the future.

Upvotes: 4

Related Questions