Skip to content
Ext JS 4.2 Driver for Play Framework 2.2.x
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Build Status Coverage Status

Ext JS Driver for Play Framework 2.2.2


  • Supports single or batched JSON requests
  • Automatic serialization and deserialization of Ext.Direct actions
  • Direct API configuration using annotations
  • DSL for creating Ext JS objects
  • Parallel execution of batched requests


  • Unit tests
  • Support for more frameworks
  • Expanding DSL

Getting started

Download the latest distributable jar here and put it in your lib folder

Add the classes from which you want to generate a Direct Api to conf/application.conf, for example:"direct.ProfileForm,direct.RegistrationForm,direct.EchoService"

Include the javascript file which generates the Direct Api inside a view:

<script type="text/javascript" src="@com.scalext.controllers.routes.Api.buildApi()"></script>

The Direct Api is now available!

Configuring the Direct API

Classes can be exposed to the Direct API by adding annotations to methods.

case class Profile(name: String, email: String, company: String)

@Remotable(name = "Scalext.example.Profile")
class Form {

  def getBasicInfo(): FormResult = {
    var profile = Profile(
      "Roy van Kaathoven",


  def updateBasicInfo(profile: Profile): FormResult = {
      errors = Map("name" -> "wrong info"))
@Remotable(name = "Scalext.example.Upload")
class Upload {

  def uploadFile(post: Any, files: Seq[TemporaryFile]): FormResult = {

    println("Post " + post)
    println("Files " + files)

    FormResult(Map("msg" -> s"${files.size} file(s) succesfully uploaded"))


The @Remotable annotation marks a method as Direct Method, which means it will be exposed to the Direct API. By default the method- or classname will be used, this can be overridden by setting the name parameter.

The @FormHandler annotation marks a method as as Form submit handler, which means it can handle form submissions and even file uploads. If the method has to read file uploads then make sure the second parameter can handle the Seq[TemporaryFile] type.


Something went wrong with that request. Please try again.