Chapter 4. The HTTP Server Framework

Table of Contents

Overview
Building a Simple Web Server
Components of the Framework
Quick Start
HTTP Server Configuration
Long-lasting HTTP requests (suspend/response)
NIO Streams
Non-Blocking Writing
Non-Blocking Reading
File Cache
AddOn
Samples

Overview

The Grizzly HTTP server framework builds off the HTTP codec framework to provide a more useful abstraction for day-to-day work. At a high level, this framework includes the following:

  • A simple server API for easy embedding of Grizzly within an application.

  • Similar abstractions to those offered by the Servlet specification: HttpHandler (Servlet), Request (HttpServletRequest), Response (HttpServletResponse).

  • The ability to deal with long running HTTP transactions via response suspend/resume facilities.

  • Support of non-blocking IO streams (inbound and outbound).

  • A file cache for static content.