Documentation

Documentation

Welcome to the play framework documentation. This documentation is intended for the 1.1.1 release and may significantly differs from previous versions of the framework.

Check the version 1.1.1 release notes.

Getting started

Your first steps with Play and your first 5 minutes of fun.

  1. Play framework overview
  2. Watch the screencast
  3. Five cool things you can do with Play
  4. Usability - details matter as much as features
  5. Frequently Asked Questions
  6. Installation guide
  7. Setting-up your preferred IDE
  8. Your first application — the ‘Hello World’ tutorial
  9. Sample applications
  10. Live coding script - to practice, and impress your colleagues with

Tutorial — Play guide, a real world app step-by-step

Learn Play by coding ‘Yet Another Blog Engine’, from start to finish. Each chapter will be a chance to learn one more cool Play feature.

  1. Starting up the project
  2. A first iteration of the data model
  3. Building the first screen
  4. The comments page
  5. Setting up a Captcha
  6. Add tagging support
  7. A basic admin area using CRUD
  8. Adding authentication
  9. Creating a custom editor area
  10. Completing the application tests
  11. Preparing for production
  12. Internationalisation and localisation

The essential documentation

Everything you need to know about Play.

  1. Main concepts
    1. The MVC application model
    2. A request life cycle
    3. Application layout & organization
    4. Development lifecycle
  2. HTTP routing
    1. The routes file syntax
    2. Routes priority
    3. Serving static resources
    4. Reverse routing: generate some URL
    5. Setting content types
    6. Content negotiation
  3. Controllers
    1. A Controller overview
    2. Retrieve HTTP parameters
    3. Advanced HTTP to Java binding
    4. Return a result
    5. Interceptions
    6. Session and Flash scopes
  4. The template engine
    1. Template syntax
    2. Template inheritance
    3. Create tags
    4. Extending the templates language
    5. Implicit objects
  5. HTTP form data validation
    1. How does it work?
    2. Retrieving error messages
    3. Displaying errors in the template
    4. Using annotations
    5. Validating objects
    6. Custom validation
  6. The domain object model
    1. Properties simulation
    2. Setup a database to persist your model objects
    3. Persist your object model with Hibernate
    4. The stateless model
  7. JPA persistence
    1. Starting the JPA entity manager
    2. Obtaining the JPA entity manager
    3. Transaction management
    4. The play.db.jpa.Model support class
    5. Finding objects
    6. Counting objects
    7. Explicit save
    8. More about generic typing problems
  8. Logging configuration
    1. Logging from your application
    2. Configure log levels
  9. Configuration in several environments
    1. The framework ID
    2. Setting the framework ID from the command line
  10. Testing the application
    1. Writing tests
    2. Fixtures
    3. Running the tests
    4. Continuous integration
  11. Deployment options
    1. Standalone Play application
    2. Running on JEE application servers
    3. Google Application Engine
    4. Stax cloud hosting platform
  12. Production deployment
    1. Configure your application.conf
    2. Configure logging
    3. Set-up a front-end HTTP server
  13. Modules and the module repository
    1. What is a module?
    2. How to load a module from an application
    3. Load default routes from modules
    4. Using the module repository
    5. Contributing a new module to the module repository
  14. Internationalization
    1. Only use UTF-8
    2. Externalize your messages
    3. Define languages supported by the application
    4. Define date format according to your locale
    5. Retrieve localized messages
  15. Cache
    1. The cache API
    2. Don’t use the Session as a cache
    3. Configure memcached
  16. Asynchronous execution using jobs
    1. Bootstrap jobs
    2. Scheduled jobs
    3. Suspendable requests
  17. Sending e-mail
    1. Mail and MVC integration
    2. SMTP configuration
    3. More about configuration
    4. Using Gmail
  18. Security Guide
    1. Sessions
    2. Cross-Site Scripting
    3. SQL Injection
    4. Cross-Site Request Forgery
  19. Ajax with JQuery
  20. OpenID integration

Distribution Modules

These optional modules are included with the standard distribution. More modules.

  1. CRUD
  2. Secure

References

Extended references for day-to-day hacking.

  1. The missing cheat sheet
  2. Browse API documentation
  3. Template tags and extensions reference
  4. Java extensions

Version notes

New versions of Play include certain changes. Check release notes for Play 1.1.1, Play 1.1, Play 1.0.3, Play 1.0.2, and Play 1.0.1.