Playframework Newbie Questions

40 views
Skip to first unread message

Anto Aravinth

unread,
Mar 29, 2017, 1:17:08 AM3/29/17
to Play Framework

I'm new to Play. I get started with Play 2.5.10 version. Seems to be promising. I have few noob questions

  1. Since play doesn't support servlet containers, which server I need to use to deploy my application?

  2. Can we mix and use both Scala and Java? In what all areas Scala might be better than Java (I'm new to Scala). What about other languages like Groovy, JRuby? Can we use them as well?

  3. Are there any advantages of bundling Play to a war (using play2War plugin)?

  4. Do we really need to know Akka to be better with Play?

  5. I love maven, is it possible to change the sbt to maven for my play project?

Greg Methvin

unread,
Mar 29, 2017, 1:56:39 AM3/29/17
to play-framework
On Tue, Mar 28, 2017 at 9:43 PM, Anto Aravinth <anto.ara...@gmail.com> wrote:

I'm new to Play. I get started with Play 2.5.10 version. Seems to be promising. I have few noob questions

  1. Since play doesn't support servlet containers, which server I need to use to deploy my application?


You can use the sbt "dist" task to create a zip file which can be extracted and run as a standalone Java application on your server. See https://www.playframework.com/documentation/2.5.x/Deploying
 
  1. Can we mix and use both Scala and Java? In what all areas Scala might be better than Java (I'm new to Scala). What about other languages like Groovy, JRuby? Can we use them as well?

Yes, you can mix Java and Scala. Play doesn't officially support languages like Groovy, JRuby, etc., but it is possible to run those languages from Java if you need to.
 
  1. Are there any advantages of bundling Play to a war (using play2War plugin)?

Not really. Deploying on an application server is not going to give you the same performance as running as standalone app using the Netty backend. The main reason that plugin exists is some people are required by their organization to deploy as a WAR, or are not comfortable switching to something else.
 
  1. Do we really need to know Akka to be better with Play?

It depends on what you want to do. If you want to do more sophisticated things with the framework like streaming requests and responses, it helps to know Akka Streams. And if you are looking to build a scalable distributed application with Play, Akka is a natural choice to use, since Play already uses Akka and provides great integration.
  1. I love maven, is it possible to change the sbt to maven for my play project?

A lot of the dev experience,especially the auto-reloading, is built on sbt. If you want to use maven, you can look at the unofficial maven plugin. You can also run a Play server within any Java application by directly adding the play-netty-server and play-java dependencies from maven and following the docs here: https://www.playframework.com/documentation/2.5.x/JavaEmbeddingPlay

Full support for maven is planned for Play 3.0 next year. Gradle also supports play.
 

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/adf2b917-987c-4a4c-a2ae-e557b6547c53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Tech Lead - Play Framework

Anto Aravinth

unread,
Mar 29, 2017, 2:19:51 AM3/29/17
to Play Framework
Hi Greg

Thanks for the reply. It really helps.

Reply all
Reply to author
Forward
0 new messages