1.1. Servlets

Servlets are Java technology's answer to Common Gateway Interface (CGI) programming. They are programs that run on a Web server, acting 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:

  1. Read any data sent by the user.

    This data is usually entered in a form on a Web page, but could also come from a Java applet or a custom HTTP client program.

  2. Look up any other information about the request that is embedded in the HTTP request.

    This information includes details about browser capabilities, cookies, the host name of the requesting client, and so forth.

  3. Generate the results.

    This process may require talking to a database, executing an RMI or ...

Get Core Servlets and JavaServer Pages™ 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.