play.api

mvc

package mvc

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

For example, a typical controller:

object Application extends Controller {

  def index = Action {
    Ok("It works!")
  }

}
Visibility
  1. Public
  2. All

Type Members

  1. trait AcceptExtractors extends AnyRef

    Define a set of extractors allowing to pattern match on the Accept HTTP header of a request

  2. case class Accepting (mimeType: String) extends Product with Serializable

    Convenient class to generate extractors checking if a given mime type matches the Accept header of a request.

  3. trait Action [A] extends (Request[A]) ⇒ Result with Handler

    An action is essentially a (Request[A] => Result) function that handles a request and generates a result to be sent to the client.

  4. trait AnyContent extends AnyRef

    A request body that adapts automatically according the request Content-Type.

  5. case class AnyContentAsFormUrlEncoded (data: Map[String, Seq[String]]) extends AnyContent with Product with Serializable

    AnyContent - Form url encoded body

  6. case class AnyContentAsJson (json: JsValue) extends AnyContent with Product with Serializable

    AnyContent - Json body

  7. case class AnyContentAsMultipartFormData (mdf: MultipartFormData[TemporaryFile]) extends AnyContent with Product with Serializable

    AnyContent - Multipart form data body

  8. case class AnyContentAsRaw (raw: RawBuffer) extends AnyContent with Product with Serializable

    AnyContent - Raw body (give access to the raw data as bytes).

  9. case class AnyContentAsText (txt: String) extends AnyContent with Product with Serializable

    AnyContent - Text body

  10. case class AnyContentAsXml (xml: NodeSeq) extends AnyContent with Product with Serializable

    AnyContent - XML body

  11. case class AsyncResult (result: Promise[Result]) extends Result with Product with Serializable

    An AsyncResult handles a Promise of result for cases where the result is not ready yet.

  12. trait BodyParser [+A] extends (RequestHeader) ⇒ Iteratee[Array[Byte], Either[Result, A]]

    A body parser parses the HTTP request body content.

  13. trait BodyParsers extends AnyRef

    Default body parsers.

  14. case class Call (method: String, url: String) extends Call with Product with Serializable

    Defines a Call, which describes an HTTP request and can be used to create links or fill redirect data.

  15. case class ChunkedResult [A] (header: ResponseHeader, chunks: Function1[play.api.libs.iteratee.Iteratee[A,Unit], _], writeable: Writeable[A]) extends PlainResult with Product with Serializable

    A chunked result, which defines the response header and a chunks enumerator to send asynchronously to the client.

  16. case class Codec (charset: String, encode: (String) ⇒ Array[Byte], decode: (Array[Byte]) ⇒ String) extends Product with Serializable

    A Codec handle the conversion of String to Byte arrays.

  17. trait Content extends AnyRef

    Generic type representing content to be sent over an HTTP response.

  18. trait Controller extends Results with BodyParsers with Status with HeaderNames with ContentTypes with RequestExtractors

    Defines utility methods to generate Action and Results types.

  19. case class Cookie (name: String, value: String, maxAge: Int, path: String, domain: Option[String], secure: Boolean, httpOnly: Boolean) extends Product with Serializable

    An HTTP cookie.

  20. trait CookieBaker [T <: AnyRef] extends AnyRef

    Trait that should be extended by the Cookie helpers.

  21. trait Cookies extends AnyRef

    The HTTP cookies set.

  22. case class Flash (data: Map[String, String]) extends Product with Serializable

    HTTP Flash scope.

  23. trait Handler extends AnyRef

    An Handler handles a request.

  24. class HandlerRef [T] extends HandlerRef

    Reference to an Handler.

  25. trait Headers extends AnyRef

    The HTTP headers set.

  26. trait JavascriptLitteral [A] extends AnyRef

    Transform a value to a Javascript literal.

  27. case class MaxSizeExceeded (length: Int) extends Product with Serializable

    Signal a max content size exceeded

  28. case class MultipartFormData [A] (dataParts: Map[String, Seq[String]], files: Seq[FilePart[A]], badParts: Seq[BadPart], missingFileParts: Seq[MissingFilePart]) extends Product with Serializable

    Multipart form data body.

  29. trait PathBindable [A] extends AnyRef

    Binder for URL path parameters.

  30. trait PlainResult extends Result

    A plain HTTP result.

  31. trait QueryStringBindable [A] extends AnyRef

    Binder for query string parameters.

  32. case class RawBuffer (memoryThreshold: Int, initialData: Array[Byte]) extends Product with Serializable

    Handle the request body a raw bytes data.

  33. trait Request [+A] extends RequestHeader

    The complete HTTP request.

  34. trait RequestExtractors extends AcceptExtractors

  35. trait RequestHeader extends AnyRef

    The HTTP request header.

  36. trait Response extends AnyRef

    The HTTP response.

  37. case class ResponseHeader (status: Int, headers: Map[String, String]) extends Product with Serializable

    A simple HTTP response header, used for standard responses.

  38. trait Result extends NotNull

    Any Action result.

  39. trait Results extends AnyRef

    Helper utilities to generate results.

  40. case class Session (data: Map[String, String]) extends Product with Serializable

    HTTP Session.

  41. case class SimpleResult [A] (header: ResponseHeader, body: Enumerator[A], writeable: Writeable[A]) extends PlainResult with Product with Serializable

    A simple result, which defines the response header and a body ready to send to the client.

  42. case class WebSocket [A] (f: (RequestHeader) ⇒ (Enumerator[A], Iteratee[A, Unit]) ⇒ Unit, frameFormatter: FrameFormatter[A]) extends Handler with Product with Serializable

    A WebSocket handler.

  43. class WrappedRequest [A] extends Request[A]

    Wrap an existing request.

Value Members

  1. object Action extends AnyRef

    Helper object to create Action values.

  2. object AnyContentAsEmpty extends AnyContent with Product with Serializable

    AnyContent - Empty request body

  3. object BodyParser extends AnyRef

    Helper object to construct BodyParser values.

  4. object BodyParsers extends BodyParsers

    Defaults BodyParsers.

  5. object Codec extends Serializable

    Default Codec support.

  6. object Cookies extends AnyRef

    Helper utilities to encode Cookies.

  7. object Flash extends CookieBaker[Flash] with Serializable

    Helper utilities to manage the Flash cookie.

  8. object JavascriptLitteral extends AnyRef

    Default JavaScript literals converters.

  9. object MultipartFormData extends Serializable

    Defines parts handled by Multipart form data.

  10. object PathBindable extends AnyRef

    Default binders for URL path part.

  11. object QueryStringBindable extends AnyRef

    Default binders for Query String

  12. object Result extends AnyRef

    Helper utilities for Result values.

  13. object Results extends Results

    Helper utilities to generate results.

  14. object Security extends AnyRef

    Helpers to create secure actions.

  15. object Session extends CookieBaker[Session] with Serializable

    Helper utilities to manage the Session cookie.

  16. object Socket extends AnyRef

    Alias types for Sockets

  17. object WebSocket extends Serializable

    Helper utilities to generate WebSocket results.