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 often 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 particularly suited to creating dynamic Web pages.

Figure 12.1. Client/server diagram showing servlets.

The following are the key features and benefits of Java servlets:

  • The servlet API provides an interface ...

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