PacktLib: Play Framework Cookbook

Play Framework Cookbook



About the Author

About the Reviewers


Basics of the Play Framework


Downloading and installing the Play framework

Creating a new application

Defining routes as the entry point to your application

Configuring your application via application.conf

Defining your own controllers

Defining your own models

Using fixtures to provide initial data

Defining your own views

Writing your own tags

Using Java Extensions to format data in your views

Adding modules to extend your application

Using Oracle or other databases with Play

Understanding suspendable requests

Understanding session management

Using Controllers


URL routing using annotation-based configuration

Basics of caching

Using HTTP digest authentication

Generating PDFs in your controllers

Binding objects using custom binders

Validating objects using annotations

Adding annotation-based right checks to your controller

Rendering JSON output

Writing your own renderRSS method as controller output

Leveraging Modules


Dependency injection with Spring

Dependency injection with Guice

Using the security module

Adding security to the CRUD module

Using the MongoDB module

Using MongoDB/GridFS to deliver files

Creating and Using APIs


Using Google Chart API as a tag

Including a Twitter search in your application

Managing different output formats

Binding JSON and XML to objects

Introduction to Writing Modules


Creating and using your own module

Building a flexible registration module

Understanding events

Managing module dependencies

Using the same model for different applications

Understanding bytecode enhancement

Adding private module repositories

Preprocessing content by integrating stylus

Integrating Dojo by adding command line options

Practical Module Examples


Adding annotations via bytecode enhancement

Implementing your own persistence layer

Integrating with messaging queues

Using Solr for indexing

Writing your own cache implementation

Running in Production


Test automation with Jenkins

Test automation with Calimoucho

Creating a distributed configuration service

Running jobs in a distributed environment

Running one Play instance for several hosts

Forcing SSL for chosen controllers

Implementing own monitoring points

Configuring log4j for log rotation

Integrating with Icinga

Integrating with Munin

Setting up the Apache web server with Play

Setting up the Nginx web server with Play

Setting up the Lighttpd web server with Play

Multi-node deployment introduction

Further Information About the Play Framework

Further Information About the Play Framework