Java Servlets - Overview

What is a Servlet?

A Servlet is an object which models the process of processing a client-server request. Servlets are mainly used to provide dynamic content within HTTP web servers.

The Servlet API was invented by Sun Microsystems as part of their wider work on the Java platform.
 

How do Servlets work?

Right now the only platform that supports Servlets is the Java platform (though a Servlet API could be expressed in many other languages, Perl particularly would be a good basis).

The Servlet API defines a base Servlet object which programmers can extend to support a particular functionality. The Servlet has access to infromation passed to the web server in the HTTP request and can build an HTTP response after processing the request. Servlets can also maintain state using a part of the Servlet API called the Session API.

Servlets are used by binding them to an HTTP URI path within a Servlet Engine. The Servlet Engine provides the environment within which a Servlet operates and is responsible for recieving the HTTP requests from the client and turning them into Java Objects. It also works out and pass control to whichever Servlet should process the request. It does this by examining the HTTP request URI path.
 

What is a Session?

The Session API allows Servlet programmers to use a variety of ways to maintain state using HTTP (a stateless protocol). For example, browser cookies could be used.
 

More information on Servlets

We can't pretend to offer a comprehensive list of information on Java Servlets but here are some pointers.

There are several good FAQs on Servlets. Here is a list of some of them:

Purple Tech Servlet FAQ
Thomas Moore's Servlet FAQ
The Open Directory project has lots of information and an FAQ on Java Servlets. Go here for that.

There is also plenty of information at Sun's Servlet site. Go here for that.
 


Created: 1 July 1999 Last Updated: Contact: webmaster Author: N.J.Ferrier