Content area
Full Text
Summary - In October 2000, Sun released the "Proposed Final Draft" specification for Servlet API 2.3. This article explains the differences between Servlet API 2.2 and 2.3, discusses the reasons for the changes, and shows you how to write servlets (and now filters!) using 2.3. (4,000 words)
On Oct. 20, 2000, Sun Microsystems published the "Proposed Final Draft" of the Servlet API 2.3 specification. (See Resources for a link to the formal specification.) Although the spec was published by Sun, Servlet API 2.3 was actually developed by the many individuals and companies working on the JSR-053 expert group, in accordance with the Java Community Process (JCP) 2.0. Danny Coward of Sun Microsystems led the servlet expert group.
The specification is not quite finished; the Proposed Final Draft is one step away from a formal Final Release, and technical details are still subject to change. However, those changes should not be significant -- in fact, server vendors have already begun to implement the new features. That means now is a good time to start learning about what's coming in Servlet API 2.3.
In this article, I will describe in detail everything that changed between API 2.2 and API 2.3. I will also explain the reasons for the changes and demonstrate how to write servlets using the new features. To keep the article focused, I will assume you're familiar with the classes and methods of previous versions of the Servlet API. If you're not, you can peruse the Resources section for links to sites (and my new book!) that will help get you up to speed.
Servlet API 2.3 actually leaves the core of servlets relatively untouched, which indicates that servlets have reached a high level of maturity. Most of the action has involved adding new features outside the core. Among the changes:
Servlets now require JDK 1.2 or later
A filter mechanism has been created (finally!)
Application lifecycle events have been added
New internationalization support has been added
The technique to express inter-JAR dependencies has been formalized
Rules for class loading have been clarified
New error and security attributes have been added
The HttpUtils class has been deprecated
Various new helpful methods have been added
Several DTD behaviors have been expanded and clarified
Other clarifications...