Chapter 3. Servlet Basics

Topics in This Chapter

  • The basic structure of servlets

  • A simple servlet that generates plain text

  • A servlet that generates HTML

  • Servlets and packages

  • Some utilities that help build HTML

  • The servlet life cycle

  • How to deal with multithreading problems

  • Tools for interactively talking to servlets

  • Servlet debugging strategies

As discussed in Chapter 1, servlets are programs that run on a Web or application server and act as a middle layer between a request coming from a Web browser or other HTTP client and databases or applications on the HTTP server. Their job is to perform the following tasks, as illustrated in Figure 3-1.

  1. Read the explicit data sent by the client.

    The end user normally enters this data in an HTML form on a Web page. ...

Get Core Servlets and JavaServer Pages™: Volume 1: Core Technologies, 2nd Edition 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.