Play Framework is the High Velocity Web Framework for Java and Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource comsumption (CPU, memory, threads) for highly-scalable applications. This app will teach you how to start building Play 2.1 apps with Scala.
The bundle includes a small bootstrap script that
can start Activator. To start Typesafe Activator's UI:
In your File Explorer, navigate into the directory that the template was extracted to, right-click on the file named "activator.bat", then select "Open", and if prompted with a warning, click to continue:
We've included the text of this template's tutorial below,
but it may work better if you view it inside Activator
on your computer. Activator tutorials are often designed
to be interactive.
Preview the tutorial
You've just created a simple Play Framework application! Now lets explore the code and make some changes.
View the App
Once the application has been compiled and the server started, your application can be accessed at: http://localhost:9000 Check in Run to see the server status. When you make an HTTP request to that URL, the Play server figures out what code to execute which will handle the request and return a response. In this application the request handler for requests to the root URL (e.g. "/") are handled by a Java Controller. You can use Java and Scala to create your controllers. Controllers asynchronously return HTTP responses of any content type (i.e. HTML, JSON, binary).
The Play Documentation contains much more exhaustive details and also covers a number of other topics which haven't been addressed in this tutorial. StackOverflow is a great place ask questions about Play. The play-framework Google Group is a great place to discuss Play.