List of Figures

Chapter 1. Introduction

Figure 1.1. "Hello world" output

Figure 1.2. Hello World in your browser

Chapter 2. A taste of Scalatra

Figure 2.1. Bacon Ipsum

Figure 2.2. Scalatra and a few related technologies

Figure 2.3. A new Scalatra project

Figure 2.4. Following a route in the browser

Figure 2.5. Generating a 404 message

Figure 2.6. The default Scalatra 404 page

Figure 2.7. Views in your project structure

Figure 2.8. Create a show.ssp template.

Figure 2.9. Template output using SSP

Figure 2.10. Adding a layout

Figure 2.11. You’ve got tests!

Figure 2.12. Test output

Figure 2.13. A compile error in the test terminal

Figure 2.14. A failure of expectations

Figure 2.15. Packaging a WAR file

Chapter 3. Routing

Figure 3.1. Anatomy of a route

Figure 3.2. Tracing a request for The_Rolling_Stones

Chapter 4. Working with user input

Figure 4.1. A YouTube search with highlighted query string parameters

Figure 4.2. GitHub uses path parameters heavily in its repository browser.

Figure 4.3. An exception resulting from bad input

Figure 4.4. The holy grail

Figure 4.5. Halt with a response body

Chapter 5. Handling JSON

Figure 5.1. A JSON document as a JValue

Chapter 6. Handling files

Figure 6.1. User interface for the document store example

Chapter 7. Server-side templating

Figure 7.1. In a traditional website, the client is served directly by Scalatra.

Figure 7.2. A RESTful API: a single Scalatra service serving disparate clients

Chapter 10. Working with a database

Figure 10.1. Components involved in the database interaction

Chapter 11. Authentication

Figure 11.1. The hacker-creation form

Figure 11.2. Dropping the database

Figure 11.3. HTTP Basic authentication in action

Figure 11.4. An unsuccessful login attempt

Figure 11.5. The login form

Figure 11.6. You can visit the hacker-creation form again.

Figure 11.7. A conditional Log In link

Figure 11.8. A Log Out link

Figure 11.9. Note the Remember Me check box

Chapter 12. Asynchronous programming

Figure 12.1. A response from the Grabber

Figure 12.2. A message from your Akka GrabActor

Figure 12.3. Running the Spark job and viewing its output

Chapter 13. Creating a RESTful JSON API with Swagger

Figure 13.1. Hacker API output

Figure 13.2. Hacker

Figure 13.3. A new Hacker added to the tracker

Figure 13.4. Creating a package for your stacks

Figure 13.5. The stacks package after refactoring

Figure 13.6. The Swagger Petstore as viewed in Swagger-ui

Figure 13.7. Exploring the pet resource

Figure 13.8. Exploring the GET /pet/{petId} method

Figure 13.9. A raw machine-readable JSON spec

Figure 13.10. The resources.json API descriptor file

Figure 13.11. Swagger spec file for the ApiController

Figure 13.12. Browsing local API docs using Swagger UI

Figure 13.13. Getting a list of hackers

Figure 13.14. Hackers-api.json with a second annotated method

Figure 13.15. Swagger UI for POST/

Figure 13.16. API authentication is now required.

Figure 13.17. A request with a good HMAC signature

Appendix Installation and development setup

Figure A.1. Making sure conscript works on Windows

Figure A.2. Making sure conscript works on Mac or Linux

Figure A.3. Making sure giter8 works

Figure A.4. Generating a Scalatra project

Figure A.5. Running Scalatra using sbt

Figure A.6. Starting the Scalatra app in a web server

Figure A.7. A Scalatra project’s structure

Figure A.8. sbt dependencies on search.maven.org

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.133.61