The Purpose and Use of Servlets

A servlet is a server-side component. It can be used to extend the functionality of any Java-enabled server, but most commonly servlets are used to write Web applications in a Web server, as shown in Figure 12.1. They are used to create Web pages where the content is not static. Web pages whose content can change according to input from the user or other variable data are called dynamic pages. Servlets are only one way to create dynamic Web pages; you will see another in Day 13, “JavaServer Pages.”

Figure 12.1. Client/server diagram showing servlets.

The following are the key features and benefits ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second 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.