Chapter 8. Producing output with view templates

This chapter covers

  • An introduction to Scala templates
  • The Scala template syntax
  • Reusing template code and components
  • Performing common tasks

We’ve seen how to structure and store data and business logs using models, and how to use controllers to bridge the gap between the Java world and the HTTP-based web.

We’ve covered the M and the C in MVC, but what about the V, the view layer? We need a view layer to present all the work our application does to the client, whether that is a browser or another system using our API.

When developing an application with Play, one of the options for creating output is using templates. You’ve probably used a templating system of some kind before, but you’ll ...

Get Play for Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.