Play for Java
Nicolas Leroux and Sietse de Kaper
Foreword by James Ward
  • February 2014
  • ISBN 9781617290909
  • 320 pages
  • printed in black & white

Helps you transition to more productive ways to build modern web apps.

From the Foreword by James Ward, Typesafe

Play for Java shows you how to build Java-based web applications using the Play 2 framework. The book starts by introducing Play through a comprehensive overview example. Then, you'll look at each facet of a typical Play application, both by exploring simple code snippets and by adding to a larger running example. Along the way, you'll contrast Play and JEE patterns and learn how a stateless web application can fit seamlessly in an enterprise environment.

Table of Contents detailed table of contents




about this book

Part 1 Introduction and first steps

1. Chapter 1 An introduction to Play

1.1. What Play is

1.2. High-productivity web development

1.3. Reactive programming

1.4. Play 2 enterprise features

1.5. Hello Play!

1.6. The console

1.7. Summary

2. Chapter 2 The parts of an application

2.1. Introducing our application

2.2. A rundown of a Play application

2.3. Play’s configuration files

2.4. Build configuration files

2.5. Public assets

2.6. Application code

2.7. Setting up an IDE

2.8. Summary

3. Chapter 3 A basic CRUD application

3.1. Adding a controller and actions

3.2. Mapping URLs to action methods using routes

3.3. Adding a model and implementing functionality

3.4. Mocking some data

3.5. Implementing the list method

3.6. Adding the product form

3.7. Handling the form submission

3.8. Adding a delete button

3.9. Summary

Part 2 Core functionality

4. Chapter 4 An enterprise app, Play-style

4.1. Recalling what an enterprise application is

4.2. Determining today’s enterprise application challenges

4.3. Understanding Play’s application in an enterprise context

4.4. Defining our warehouse enterprise application

4.5. Summary

5. Chapter 5 Controllers—handling HTTP requests

5.1. Controllers and action methods

5.2. Returning results from action methods

5.3. Using routing to wire URLs to action methods

5.4. Interceptors

5.5. About scopes

5.6. Summary

6. Chapter 6 Handling user input

6.1. Forms

6.2. Data binding

6.3. Body parsers

6.4. Validation

6.5. File uploads

6.6. Summary

7. Chapter 7 Models and persistence

7.1. Modeling the real world in code

7.2. Persistence and Object-Relational Mapping (ORM)

7.3. Mapping basic entities

7.4. Mapping relationships

7.5. Querying for objects

7.6. Using JPA instead of Ebean

7.7. Summary

8. Chapter 8 Producing output with view templates

8.1. The benefits of compiled, type-safe templates

8.2. Scala template syntax

8.3. Your basic building blocks

8.4. Structuring pages with template composition

8.5. Using LESS and CoffeeScript: the asset pipeline

8.6. Internationalization

8.7. Summary

Part 3 Advanced topics

9. Chapter 9 Asynchronous data

9.1. What do we mean by asynchronous data?

9.2. Handling asynchronous data

9.3. Scheduling asynchronous tasks

9.4. Streaming HTTP responses

9.5. Unidirectional communication with Comet

9.6. Bidirectional communication with WebSockets

9.7. Summary

10. Chapter 10 Security

10.1. Play security concepts

10.2. Adding basic authentication with filters

10.3. Fine-grained authentication with action composition

10.4. Summary

11. Chapter 11 Modules and deployment

11.1. Modules

11.2. Splitting your application into multiple sub-applications

11.3. Deploying to production

11.4. Summary

12. Chapter 12 Testing your application

12.1. Testing Play applications

12.2. Functional testing

12.3. Integration testing

12.4. Summary


© 2014 Manning Publications Co.

About the book

For a Java developer, the Play web application framework is a breath of fresh air. With Play you get the power of Scala's strong type system and functional programming model, and a rock-solid Java API that makes it a snap to create stateless, event-driven, browser-based applications ready to deploy against your existing infrastructure.

Play for Java teaches you to build Java-based web applications using Play 2. This book starts with an overview example and then explores each facet of a typical application by discussing simple snippets as they are added to a larger example. Along the way, you'll contrast Play and JEE patterns and learn how a stateless web application can fit seamlessly in an enterprise Java environment. You'll also learn how to develop asynchronous and reactive web applications.

What's inside

  • Build Play 2 applications using Java
  • Leverage your JEE skills
  • Work in an asynchronous way
  • Secure and test your Play application

About the reader

The book requires a background in Java. No knowledge of Play or of Scala is assumed.

About the author

Nicolas Leroux is a core developer of the Play framework. Sietse de Kaper develops and deploys Java-based Play applications.

Play for Java (combo) added to cart
continue shopping
go to cart

combo $49.99 pBook + eBook + liveBook
Play for Java (eBook) added to cart
continue shopping
go to cart

eBook $39.99 pdf + ePub + kindle + liveBook

FREE domestic shipping on three or more pBooks

The easiest way to learn the easiest web framework.

Franco Lombardo, Molteni Informatica

The definitive guide to Play 2 for Java.

Ricky Yim, DiUS Computing

A good cocktail of theory and practical information.

Jeroen Nouws, XTI

An excellent tutorial on the Play 2 framework.

Lochana C. Menikarachchi, PhD, University of Connecticut