Mastering Play Framework for Scala
eBook - ePub

Mastering Play Framework for Scala

Shiti Saxena

Share book
  1. 274 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Play Framework for Scala

Shiti Saxena

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Play Framework for Scala an online PDF/ePUB?
Yes, you can access Mastering Play Framework for Scala by Shiti Saxena in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.

Information

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...

Table of contents