万本电子书0元读

万本电子书0元读

顶部广告

Play Framework Essentials电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Julien Richard-Foy

出  版  社:Packt Publishing

出版时间:2014-09-25

字       数:127.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
This book targets Java and Scala developers who already have some experience in web development and who want to master Play framework quickly and efficiently. This book assumes you have a good level of knowledge and understanding of efficient Java and Scala code.
目录展开

Play Framework Essentials

Table of Contents

Play Framework Essentials

Credits

About the Author

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. Building a Web Service

Play – a framework used to write web applications

Bootstrapping a Play application

Play applications' layout

URL routing

Route path parameters

Parameters type coercion

Parameters with fixed values

Query string parameters

Default values of query string parameters

Trying the routes

Building HTTP responses

Serializing application data in JSON

Reading JSON requests

Validating JSON data

Handling optional values and recursive types

Summary

2. Persisting Data and Testing

Testing your web service

Writing and running tests

Testing the HTTP layer

Using the reverse router to generate URLs

Running a fake Play application

Effectively writing HTTP tests

Persisting data

Using a relational database

Getting a reference to the currently running application

Using a database management library

Using Slick in Scala

Using JPA in Java

Integrating with other persistence technologies

Populating the database with fixtures

The application's Global object

Managing database schema evolutions

Using an in-memory database for tests

Summary

3. Turning a Web Service into a Web Application

Delta between a web service and a web application

Using the template engine to build web pages

Inserting dynamic values

Looping and branching

Reusing document fragments

Comments

Import statements

Generating HTML forms

Repeated and nested fields

Reading and validating HTML form data

Handling the HTML form submission

Validating the HTML form data

The Scala form validation API

The Java form validation API

Optional and mandatory fields

Sharing JSON validation and HTML form validation rules

Handling content negotiation

Putting things together

Writing web user interface tests

Summary

4. Integrating with Client-side Technologies

Philosophy of Play regarding client-side technologies

Serving static assets

Sprinkling some JavaScript and CSS

Using the JavaScript reverse router

Managing assets from the build system

Producing web assets

Pipelining web assets' transformations

Concatenating and minifying JavaScript files

Gzipping assets

Fingerprinting assets

Managing JavaScript dependencies

Running JavaScript tests

Summary

5. Reactively Handling Long-running Requests

Play application's execution model

Scaling up your server

Embracing non-blocking APIs

Managing execution contexts

Writing incremental computations using iteratees

Streaming results using enumerators

Manipulating data streams by combining iteratees, enumerators, and enumeratees

Unidirectional streaming with server-sent events

Preparing the ground

Transforming streams of data using enumeratees

Implementing a publish/subscribe system using Akka

Bidirectional streaming with WebSockets

Controlling the data flow

Summary

6. Leveraging the Play Stack – Security, Internationalization, Cache, and the HTTP Client

Handling security concerns

Authentication

Cross-site scripting

Cross-site request forgery

HTTP request filters

Using the CSRF filter

Enabling HTTPS

Saving computation time using cache

Serving content in several languages

Calling remote web services

Background – the OAuth 2.0 protocol

Integrating your application with your preferred social network

Implementing the OAuth client

Calling the HTTP API of your preferred social network

Summary

7. Scaling Your Codebase and Deploying Your Application

Making an action's logic reusable and composable with action builders

Capturing the logic of actions that use blocking APIs

Capturing the logic of actions that require authentication

Combining action builders

Modularizing your code

Applying the inversion of control principle

Using dynamic calls in route definitions

Setting up a dependency injection system

Making your code injectable

Mocking components

Splitting your code into several artifacts

Splitting your controller layer into several artifacts

Application deployment

Deploying to your dedicated infrastructure

Deploying to the cloud

Handling per environment configuration

Overriding configuration settings using Java system properties

Using different configuration files

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部