5.1. What Is a Servlet?
A servlet is a piece of server-side Java that responds to requests coming in from a client. Although servlets can be created for any protocol that is based on requests and responses, by far the overwhelming majority of servlets are built to handle HTTP requests. In this book, we'll only consider HTTP servlets.
Servlets are frequently compared to applets, and considered a server-side replacement for applets. However, in functionality, what they really replace are CGI scripts (see Chapter 4). Servlets don't provide all of the user interface flexibility that applets can provide, and in fact some deployments of servlets use applets as the client-side technology. HTML is the most widely used presentation option, and our servlets ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access