package util
Ordering
- Alphabetic
Visibility
- Public
- All
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.
import play.api.Play.current
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 For example:
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)) } //then in a controller: object MyController extends 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 } }