Scalatra is a simple, accessible and free web micro-framework.

It combines the power of the JVM with the beauty and brevity of Scala, helping you quickly build high-performance web sites and APIs.

Ready

Get set up in 2 easy steps with our quick installation guide. There's a good chance that you already have most of the software you need.

Get started »

Steady

We've documented the main aspects of Scalatra development in a handy set of reference guides, to help you become productive quickly.

View the guides »

Code

We have a very active community, and an enthusiastic group of developers working on the next version.

Get involved »

Why would you want to use Scalatra?

  • It's been proven in production - the BBC, LinkedIn, the Guardian newspaper, Box.com, Netflix, and the UK government all rely on it.
  • It can help you quickly build high-performance, scalable HTTP APIs for web and mobile applications.
  • It's a perfect server-side counterpart to in-browser client development frameworks such as backbone.js, ember.js or angular.js.
  • It's a simple, fun, and practical way to learn Scala, a new programming language with advanced features.
  • It will help you use all available cores of that new 16-core server. It also gives you easy access to Scala's new concurrency-management constructs: Akka Actors.

We've got a book!

Order Scalatra in Action as part of the Manning Early Access Program (MEAP).

Written by members of the Scalatra team, the book walks you through the entire framework, from first steps to servlet deployment.

Start small

You will need to install a few things before you can get started, but first, here's a Scalatra app:

package com.example.app
import org.scalatra._

class HelloWorldApp extends ScalatraFilter {
  get("/") {
    <h1>Hello, {params("name")}</h1>
  }
}

Notice a few things about it:

  • It's small - a full web application in 7 lines of code.
  • It uses a Sinatra-style DSL.
  • It defines a single method, an HTTP GET to the path "/".
  • It renders a response, in this case the text Hello world!

This is the essence of Scalatra - a simple, easy to understand way to make web systems, which embraces HTTP's stateless nature. You can build anything you want with Scalatra, but one of the things it's been most successful at is the construction of RESTful APIs.

Scale up and customize

Scalatra is a micro-framework, so you start small and build upwards.

You can easily add exactly the libraries you want - for data models, templating, unit and integration testing, async request handling, or server-push.

We can't predict what you'll want to build, or how you'll want to build it. Instead of prescribing a set of libraries for you to use, and building the framework around that, we let you choose.

Versions

Scalatra Version Status Source Scala versions Servlet Netty
2.0.4 Stable master
  • 2.9.1
  • 2.9.0-1
  • 2.8.2
  • 2.8.1
2.5 N/A
2.0.5-SNAPSHOT Testing 2.0.x
  • 2.9.1
  • 2.9.0-1
  • 2.8.2
  • 2.8.1
2.5 N/A
2.2.2 Stable 2.2.x
  • 2.9.x
  • 2.10.x
3.0 N/A
2.3.0-SNAPSHOT Development develop
  • 2.9.x
  • 2.10.x
3.0 N/A