Play Framework 2.0 is a major revision of Play, a Ruby on Rails-like framework for the Java platform. Version 2.0 introduces features such as the use of Scala language, Akka actors, Scala templates and a build system (SBT).
Play is based on a lightweight, stateless, web-friendly architecture and features predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications - thanks to its reactive model, based on Iteratee I/O.
How can I change the default port used by the play framework in development mode when issueing the "run" command on the play console.
This is for playframework 2.0 beta.
Using the http.port configuration parameter either on the command line or in…
In play1, I usually get all data in actions, use them directly in views. Since we don't need to explicitly declare parameters in view, this is very easy.
But in play2, I found we have to declare all the parameters(including request) in the head of…
I'm new to Play framework. I'm trying to configure MySQL database as a datasource to be used with Play Ebeans.
Could you some one please explain the steps that are needed to configure MySQL with Play 2.0 framework (like, downloading drivers, adding…
I try to understand some Slick works and what it requires.
Here it an example:
package models
case class Bar(id: Option[Int] = None, name: String)
object Bars extends Table[Bar]("bar") {
def id = column[Int]("id", O.PrimaryKey, O.AutoInc)
//…
I have a Play Framework application and I was using Hibernate 4.2.5.Final (which is retrieved via the Maven dependency manager). I decided to upgrade to Hibernate 4.3.0.Final, recompile my application successfully, and ran it.
I got the exception…
Previously in Play! v1 it was really easy to define configuration variables in application.conf and then access them like so:
play.configuration("db.driver")
However now I can't find anything in the documentation for similar uses in v2 or a proper…
Lets say I have an already functioning Play 2.0 framework based application in Scala that serves a URL such as:
http://localhost:9000/birthdays
which responds with a listing of all known birthdays
I now want to enhance this by adding the ability to…
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…
I'm using Slick with a Play Framework 2.1 and I have some troubles.
Given the following entity...
package models
import scala.slick.driver.PostgresDriver.simple._
case class Account(id: Option[Long], email: String, password: String)
object…
So I have successfully gotten AJAX requests to work before but I have always had to use a form, and then at the end of the submit do return false so that it doesn't refresh the page.
I have also just recently moved my JavaScript into a separate file…
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…
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:…
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'")
…
I used play2 before with java. It felt a little bit like boilerplate especially if you used akka with java. But that is not the fault of the framework.
Yesterday I read "Scala for the impatient" and I really enjoy the language.
Now I looked at both…
I want to declare a variable with name 'type' in a Play/Scala application, since my data has this field name and I'm using JSON transforms. It just makes more sense.
Fortunately I could just rename the field, but still curious if there is a way to…