Play framework essentials : an intuitive guide to creating easy-to-build scalable web applications using the Play framework /
Chapter 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 cu...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing,
2014.
|
Colección: | Community experience distilled.
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 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.
- Using an in-memory database for testsSummary; Chapter 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 rulesHandling content negotiation; Putting things together; Writing web user interface tests; Summary; Chapter 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 testsSummary; Chapter 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.