Java servlets are making headlines these days, claiming to solve many of the problems associated with CGI and proprietary server API's. In this article Nakul describes the overall servlet architecture and what you need to develop a web application using servlets. He uses several coding examples to show you how to use the servlet API and compares it with CGI and proprietary server API's.
An Introduction to Java Servlets - The servlet runtime environment (Page 4 of 10 )
A servlet is a Java class and therefore needs to be executed in a Java virtual machine (JVM) by a service which is called a servlet engine.
The servlet engine loads the servlet class the first time the servlet is requested, or optionally right away when the servlet engine is started. The servlet then stays loaded to handle multiple requests until it is explicitly unloaded or the servlet engine is shut down.
Some Web servers such as Sun's Java Web Server (JWS), W3C's Jigsaw and Gefion Software's LiteWebServer (LWS) are implemented in Java and have a built-in servlet engine. Other Web servers, such as Netscape's Enterprise Server, Microsoft's Internet Information Server (IIS) and the Apache Group's Apache, require a servlet engine add-on module. The add-on intercepts all requests for servlets, executes them and returning the response through the Web server to the clients browser. Examples of servlet engine add-ons are Gefion Software's WAICoolRunner, IBM's WebSphere, Live Software's JRun and New Atlanta's ServletExec.
All servlet API classes and a simple servlet-enabled Web server are combined to form the Java Servlet Development Kit (JSDK), available for download at Sun's official servlet site. To get started with servlets, I recommend that you download the JSDK and play around with the sample servlets right here.