O'Reilly logo

Play Framework Cookbook - Second Edition by Giancarlo Inductivo, Alexander Reelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Using Controllers

In this chapter, we will cover the following recipes:

  • Using HTTP headers
  • Using HTTP cookies
  • Using the session
  • Using custom actions
  • Using filters
  • Using path binders
  • Serving JSON
  • Receiving JSON
  • Uploading files
  • Using futures and Akka actors

Introduction

In this chapter, we will dive in a little deeper into Play controllers and discuss some advanced topics regarding controllers in web applications. We will also learn how Play can handle and address more modern web app requirements besides the common use cases such as data manipulation and data retrieval. As we rely on controllers to route web requests and responses, we want to ensure that our controllers are as lightweight and as decoupled as possible, to ensure page responsiveness ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required