Questions tagged [playframework]

Play Framework is a modern open-source web framework for Java and Scala.

Play Framework is a modern open-source web framework for Java and Scala. Play provides a clean alternative to legacy Java stacks. Play is based on a lightweight, stateless, web-friendly architecture. Play has two versions: Play 1.x and Play 2.x.

Other related tags

Play Resources

Play 1.x Resources

Play 2.x Resources

17050 questions
62
votes
13 answers

Accessing the application.conf properties from java class with Play! 2.0

I want to add an object to the Global scope, and in order to construct it I need to pass it a path to a file. I don't want to hard code the file path in the source, and so I want to get that path from the application.conf. The problem is that I…
Nitzan Tomer
  • 120,901
  • 33
  • 273
  • 264
62
votes
5 answers

Jenkins + Play 1.2.4 : problems with cobertura lock files / report

We have a Play 1.2.4 application and we got Jenkins (on Ubuntu) for the application. We're having problems with Cobertura. After running the tests (succesfully), every now and then, we get the following…
Touko
  • 10,399
  • 14
  • 71
  • 101
61
votes
3 answers

Play framework hangs on startup at: "Loading project definition from"

I am just getting started with Play Framework. I have downloaded and installed play and created a sample java application. When I try to start the play console in the application directory it hangs at "Loading project definition". PS…
Peter Moberg
  • 3,088
  • 4
  • 27
  • 34
60
votes
1 answer

How is Akka used in Play?

Play's home page says: Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications. I'd like to know exactly how and where Akka is used in Play and what are the consequences of…
OlivierBlanvillain
  • 7,475
  • 4
  • 29
  • 49
57
votes
5 answers

How can colored terminal output be disabled for sbt/play?

I would like to disable the color escape codes logged from sbt/play. Is this possible? And if it is, is there a way to do it without making changes to the config - i.e. via a command line switch or system property.
Mark Hibberd
  • 1,988
  • 1
  • 14
  • 12
57
votes
8 answers

Declare variable in a Play2 scala template

How do you declare and initialize a variable to be used locally in a Play2 Scala template? I have this: @var title : String = "Home" declared at the top of the template, but it gives me this error: illegal start of simple expression…
travega
  • 7,962
  • 16
  • 58
  • 89
55
votes
2 answers

NodeJS vs Play Framework for large project

I am really torn between two different stacks with which to build a large application. One the one hand there is this option: Node.js express coffee script coffeekup mongoose/mongodb or presistencejs/mysql Play Framework w/ Scala Anorm w/…
Jason Miesionczek
  • 13,718
  • 14
  • 73
  • 108
53
votes
6 answers

What are the major differences between Play Framework 1.0 and 2.0?

With the recent release of Play Framework 2.0, I would like to know if anyone could summarize ,from a high level standpoint, the major differences between Play Framework 1 & 2. I already compiled a few (play 1.0 -> play 2.0): Template engine:…
Olivier Refalo
  • 46,213
  • 20
  • 84
  • 114
51
votes
3 answers

-Ywarn-unused-import triggering on play routes file

I want to be able to use -Xfatal-warnings and -Ywarn-unused-import, the problem is that the compiler is triggering an error on the file which contains the play routes for my application: [error] /path/to/app/conf/routes: Unused import [error]…
Ende Neu
  • 14,921
  • 5
  • 50
  • 67
51
votes
1 answer

Web Frameworks: How is Play different from Spring MVC?

The Play Framework offers the following quick overview, but with the exception of the Groovy template engine (which you can get in Spring MVC if you want), Spring seems to offer all the same features and more... Fix the bug and hit reload! Edit…
Play vs. Spring
  • 527
  • 1
  • 4
  • 3
50
votes
6 answers

Why does java wait so long to run the garbage collector?

I am building a Java web app, using the Play! Framework. I'm hosting it on playapps.net. I have been puzzling for a while over the provided graphs of memory consumption. Here is a sample: The graph comes from a period of consistent but nominal…
goggin13
  • 6,996
  • 6
  • 26
  • 43
50
votes
2 answers

Play Framework 2.1 - Cannot find an implicit ExecutionContext

I am calling a webservice like this: WS .url(url) .get .map { response => // error occurs on this line response.status match { case 200 => Right(response.json) case status => Left(s"Problem accessing api, status '$status'") …
EECOLOR
  • 11,034
  • 3
  • 38
  • 72
47
votes
6 answers

Where do I put startup code in Play Framework?

I want to run some code on startup to pre-cache some stuff, and would also like to start a Timer to re-cache some things outside the critical path of a web request. Is this possible with Play Framework, and where so I put this code?
sanity
  • 33,862
  • 40
  • 131
  • 218
47
votes
5 answers

Adding Play JSON Library to sbt

How can I add the Play JSON library (play.api.libs.json) to my sbt project? When I added the following to my plugins.sbt file: addSbtPlugin("play" % "sbt-plugin" % "2.1.0") I faced this error: [warn] …
Kevin Meredith
  • 38,251
  • 58
  • 190
  • 340
46
votes
4 answers

Noise free JSON format for sealed traits with Play 2.2 library

I need to get a simple JSON serialization solution with minimum ceremony. So I was quite happy finding this forthcoming Play 2.2 library. This works perfectly with plain case classes, e.g. import play.api.libs.json._ sealed trait Foo case class…
0__
  • 64,257
  • 16
  • 158
  • 253