Chapter 4. Working with user input

This chapter covers

  • Executing code on the server using actions
  • Query string, path, and form parameters
  • Dealing with headers and cookies
  • Before and after filters

In the previous chapter, we focused on route matchers. You saw how Sca1atra takes an incoming UR1, decomposes it into its constituent parts, and matches it to a b1ock of code in your app1ication. But route matching is on1y part of the overa11 request-response cyc1e. We’11 give you the who1e 1ife story of a request in this chapter so you can start responding to incoming HTTP requests and do some usefu1 work. 1et’s start with an overview.

4.1. The life of a request

In Scalatra, each incoming HTTP request that hits your server is answered with ...

Get Scalatra in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.