package util
Ordering
- Alphabetic
Visibility
- Public
- Protected
Type Members
- trait LazyHelper[M[_], T] extends AnyRef
Value Members
- object LazyHelper
Play framework.
Contains the public API for Scala developers.
Contains the public API for Scala developers.
val poolSize = configuration.getInt("engine.pool.size")
Logger.info("Hello!")
class MyPlugin(app: Application) extends Plugin
val application = Application(new File("."), this.getClass.getClassloader, None, Play.Mode.DEV)
Contains various APIs that are useful while developing web applications.
Contains various APIs that are useful while developing web applications.
Json API
Json API
For example:
import play.api.libs.json._ import play.api.libs.functional.syntax._ case class User(id: Long, name: String, friends: Seq[User] = Seq.empty) object User { // In this format, an undefined friends property is mapped to an empty list implicit val format: Format[User] = ( (__ \ "id").format[Long] and (__ \ "name").format[String] and (__ \ "friends").lazyFormatNullable(implicitly[Format[Seq[User]]]) .inmap[Seq[User]](_ getOrElse Seq.empty, Some(_)) )(User.apply, unlift(User.unapply)) } object MyController extends play.api.mvc.Controller { def displayUserAsJson(id: String) = Action { Ok(Json.toJson(User(id.toLong, "myName"))) } def saveUser(jsonString: String)= Action { val user = Json.parse(jsonString).as[User] //myDataStore.save(user) Ok } }