Packages

  • package root
    Definition Classes
    root
  • package play

    Play framework.

    Play framework.

    Play

    http://www.playframework.com

    Definition Classes
    root
  • package api

    Contains the public API for Scala developers.

    Contains the public API for Scala developers.

    Access the current Play application
    import play.api.Play.current
    Read configuration
    val poolSize = configuration.getInt("engine.pool.size")
    Use the logger
    Logger.info("Hello!")
    Define a Plugin
    class MyPlugin(app: Application) extends Plugin
    Create adhoc applications (for testing)
    val application = Application(new File("."), this.getClass.getClassloader, None, Play.Mode.DEV)
    Definition Classes
    play
  • package cache

    Contains the Cache access API.

    Contains the Cache access API.

    Definition Classes
    api
  • package ehcache
  • AsyncCacheApi
  • CacheApi
  • Cached
  • CachedBuilder
  • DefaultSyncCacheApi
  • SyncCacheApi
  • package controllers
    Definition Classes
    api
  • package data

    Contains data manipulation helpers (typically HTTP form handling)

    Contains data manipulation helpers (typically HTTP form handling)

    import play.api.data._
    import play.api.data.Forms._
    
    val taskForm = Form(
      tuple(
        "name" -> text(minLength = 3),
        "dueDate" -> date("yyyy-MM-dd"),
        "done" -> boolean
      )
    )
    Definition Classes
    api
  • package db

    Contains the JDBC database access API.

    Contains the JDBC database access API.

    Example, retrieving a connection from the 'customers' datasource:

    val conn = db.getConnection("customers")
    Definition Classes
    api
  • package http

    Contains standard HTTP constants.

    Contains standard HTTP constants. For example:

    val text = ContentTypes.TEXT
    val ok = Status.OK
    val accept = HeaderNames.ACCEPT
    Definition Classes
    api
  • package i18n

    Contains the internationalisation API.

    Contains the internationalisation API.

    For example, translating a message:

    val msgString = Messages("items.found", items.size)
    Definition Classes
    api
  • package inject

    Play's runtime dependency injection abstraction.

    Play's runtime dependency injection abstraction.

    Play's runtime dependency injection support is built on JSR-330, which provides a specification for declaring how dependencies get wired to components. JSR-330 however does not address how components are provided to or located by a DI container. Play's API seeks to address this in a DI container agnostic way.

    The reason for providing this abstraction is so that Play, the modules it provides, and third party modules can all express their bindings in a way that is not specific to any one DI container.

    Components are bound in the DI container. Each binding is identified by a BindingKey, which is typically an interface that the component implements, and may be optionally qualified by a JSR-330 qualifier annotation. A binding key is bound to a BindingTarget, which describes how the implementation of the interface that the binding key represents is constructed or provided. Bindings may also be scoped using JSR-330 scope annotations.

    Bindings are provided by instances of Module.

    Out of the box, Play provides an implementation of this abstraction using Guice.

    Definition Classes
    api
    See also

    The Module class for information on how to provide bindings.

  • package libs

    Contains various APIs that are useful while developing web applications.

    Contains various APIs that are useful while developing web applications.

    Definition Classes
    api
  • package mvc

    Contains the Controller/Action/Result API to handle HTTP requests.

    Contains the Controller/Action/Result API to handle HTTP requests.

    For example, a typical controller:

    class HomeController @Inject() (val controllerComponents: ControllerComponents) extends BaseController {
    
      def index = Action {
        Ok("It works!")
      }
    
    }
    Definition Classes
    api
  • package routing
    Definition Classes
    api
  • package templates
    Definition Classes
    api
  • package test

    Contains test helpers.

    Contains test helpers.

    Definition Classes
    api
p

play.api

cache

package cache

Contains the Cache access API.

Source
package.scala
Linear Supertypes
AnyRef, Any

Type Members

  1. trait AsyncCacheApi extends AnyRef

    The cache API

  2. class Cached extends AnyRef

    A helper to add caching to an Action.

  3. final class CachedBuilder extends AnyRef

    Builds an action with caching behavior.

    Builds an action with caching behavior. Typically created with one of the methods in the Cached class. Uses both server and client caches:

    • Adds an Expires header to the response, so clients can cache response content ;
    • Adds an Etag header to the response, so clients can cache response content and ask the server for freshness ;
    • Cache the result on the server, so the underlying action is not computed at each call.
  4. class DefaultSyncCacheApi extends SyncCacheApi with CacheApi

    A SyncCacheApi that wraps an AsyncCacheApi

  5. type NamedCache = cache.NamedCache
  6. trait SyncCacheApi extends AnyRef

    A cache API that uses synchronous calls rather than async calls.

    A cache API that uses synchronous calls rather than async calls. Useful when you know you have a fast in-memory cache.

  7. trait CacheApi extends AnyRef

    A cache API.

    A cache API. This class is deprecated and will be removed in future versions.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use SyncCacheApi or AsyncCacheApi instead

Inherited from AnyRef

Inherited from Any

Ungrouped