O'Reilly logo

Play for Scala: Covers Play 2 by Peter Hilton, Erik Bakker, and Francisco Canedo

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 7. Validating and processing input with the forms API

This chapter covers

  • The main concepts of Play’s forms API
  • How to process HTML form submits
  • Generating HTML forms
  • Parsing advanced types and building custom validations

A serious test of any web framework is the way it handles data thrown at it by clients. Clients can send data as a part of the URL (notably the query string), as HTTP request headers, or in the body of an HTTP request. In the latter case, there are various ways to encode the data; the usual ways are submitting HTML forms and sending JSON data.

When this data is received, you can’t trust it to be what you want or expect it to be. After all, the person using your application can shape a request any way they like, ...

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