Mastering Play Framework for Scala
eBook - ePub

Mastering Play Framework for Scala

Shiti Saxena

Condividi libro
  1. 274 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Mastering Play Framework for Scala

Shiti Saxena

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Mastering Play Framework for Scala è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Mastering Play Framework for Scala di Shiti Saxena in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Application Development. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2015
ISBN
9781783983803

Mastering Play Framework for Scala


Table of Contents

Mastering Play Framework for Scala
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Play
Venturing into the world of Play
A sample Play app
Building a Play application using Activator
The build definition
The source code
Request handling process
Creating a TaskTracker application
Adding a new task
Deleting a task
Summary
2. Defining Actions
A dummy Artist model
Actions
Actions with parameters
Request body parsers
Extending a parser
Exploring the results
Asynchronous Actions
Content negotiation
Filters
Action composition
The need for an Action composition
Differentiating between Action composition and filters
Customized requests
The need for a user object
Troubleshooting
Summary
3. Building Routes
Introduction to Play routes
Automatic generation of routes_routing.scala
Reverse routing
JavaScript reverse routing
Assets
Client-side libraries
Configuring route definitions
Dynamic paths
Static paths
Configuring request parameters
Troubleshooting
Summary
4. Exploring Views
Diving into Scala templates
Building a view
Generating forms
Adding constraints on data
Handling errors
Form-field helpers
Internationalization
Supporting views in multiple languages
Understanding internationalization
Scala templating in Play
Understanding the working of Twirl
Troubleshooting
Summary
5. Working with Data
Introducing models
JDBC
Anorm
Slick
ReactiveMongo
The Cache API
Troubleshooting
Summary
6. Reactive Data Streams
Basics of handling data streams
Iteratees
Enumerator
Using the Concurrent object
Unicast
Broadcast
Enumeratees
Binding an Enumeratee to an Enumerator
Binding an Enumeratee to an Iteratee
Summary
7. Playing with Globals
GlobalSettings
The life cycle of an application
Meddling with an application's life cycle
The request-response life cycle
Fiddling with the request-response life cycle
Manipulating requests and their responses
Tackling errors and exceptions
Summary
8. WebSockets and Actors
An introduction to WebSockets
WebSockets in Play
Actor Model
Introducing Akka Actors
WebSocket using Iteratee
WebSocket using Actors without Iteratees
Closing a WebSocket
Using FrameFormatter
Troubleshooting
Summary
9. Testing
The setup for writing tests
Unit testing
Dissecting PlaySpecification
Unit testing a controller
Using traits for controllers
Using dependency injection
Functional testing
Using Specs2
Using ScalaTest
Summary
10. Debugging and Logging
Debugging a Play application
Configuring an IDE for debugging
Experimenting in a Scala console
Logging
Play's logging API
Log configuration in Play
Log levels
Summary
11. Web Services and Authentication
Calling web services
OpenID
OAuth
Summary
12. Play in Production
Deploying a Play application
Using the start command
Using a distribution
Universal distribution
Debian distribution
The rpm distribution
Windows distribution
Configuring for production
Enabling SSL
Using a load balancer
Apache HTTP
The nginx server
lighttpd
High Availability Proxy
Troubleshooting
Summary
13. Writing Play Plugins
Plugin definition
Plugin declaration
Exposing services through plugins
Tips for writing a plugin
Summary
Index

Mastering Play Framework for Scala

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2015
Production reference: 1260515
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-380-3
www.packtpub.com

Credits

Author
Shiti Saxena
Reviewers
Didier Bathily
Jérôme Leleu
Jon Parsons
Commissioning Editor
Amarabha Banerjee
Acquisition Editor
Subho Gupta
Content Development Editor
Sriram Neelakantan
Technical Editors
Novina Kewalramani
Manal Pednekar
Shruti Rawool
Copy Editors
Sonia Michelle Cheema
Vikrant Phadke
Project Coordinator
Vijay Kushlani
Proofreaders
Stephen Copestake
Safis Editing
Indexer
Monica Ajmera Mehta
Graphics
Sheetal Aute
Disha Haria
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta

About the Author

Shiti Saxena is a software engineer with around 4 years of work experience. She is currently working with Imaginea (a business unit of Pramati). She has previously worked with Tata Consultancy Services Ltd. and Genpact.
A true polyglot, she's had exposure to various languages, including Scala, JavaScript, Java, Python, Perl, and C. She likes to work with Play Scala and AngularJS.
She blogs at http://eraoferrors.blogspot.in and maintains open source projects on GitHub.
She loves to travel, is a movie buff, and likes to spend time playing her piano whenever she is not programming.
She has authored Getting Started with SBT for Scala (https://www...

Indice dei contenuti