O'Reilly logo

Learning Play! Framework 2 by Andy Petrella

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 4. Handling Data on the Server Side

In the previous chapter, we were introduced to the templating system that enables us to create amazing views or to render data coming from the server.

In this chapter, we'll focus on this last point: server data. Until now, it was hardcoded in our actions and given directly to the views.

Of course, it's never that simple; data is regularly coming from a database, or at least has been provided (at some time) by a user. So, we'll see how Play! 2 deals with these use cases. The following is an overview of what will be achieved in this chapter:

  • Create an HTML form to represent data
  • Send data to the server
  • Retrieve data from the server
  • Add constraints to the data
  • Persist data in a relational database
  • Provide and ...

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