Home

This document summarizes the current implementation state of the new features of the Servlet 2.3 draft specification in Catalina. To give a quick synopsis of the completion state of each new feature, we're using a "how would you like your steak" metaphor. Apologies to all the vegetarians out there!

## Application Events [Medium Well]

You can now register event listeners in the web.xml file that receive notification when the following events occur:

- Application startup
- Application shutdown
- New, replaced, or removed application (servlet context) attributes
- Session created
- Session invalidated or timed out
- New, replaced, or removed session attributes

Application listener functionality has been added to Catalina, and seems to work fairly well. There are two listeners in the "examples" web application that simply log things with ServletContext.log() to show that they were reached.

## Servlet Filters [Medium Rare]

You can now register Filters in the web.xml file that are the application level analogue to Valves in the Catalina core. Filters have the following general features:

- Filters can be mapped to either URL patterns or particular servlets
- Filters can pre-process and post-process requests and responses
- Filters can wrap the request and/or response objects that are passed on (so you can do content type transformations, for example)
- Filters can respond to a request and return, instead of passing the request on (for example, you can do authentication challenges at the app level)

Related to this, servlets can now do the same sort of wrapping when they pass arguments to a RequestDispatcher. Previously, you were required to pass the original request and response objects received from the container.

Servlet filter functionality has been added to Catalina, and lightly tested, although wrapping has not been thoroughly tested yet. There is a filter in the "examples" application that is set up as both path mapped and servlet mapped to the invoker servlet ("/servlet/*"), which stores a request attribute that is passed on to the servlet that is ultimately executed.

## Dependencies on Installed Extensions [Raw]

Web applications, or the JAR files in the WEB-INF/lib directory, can now declare their dependence on particular versions of external libraries that may be provided by the container as shared extensions. No work has been done to implement this capability in Catalina yet.

## Internationalization Fixes [Medium Rare]

Catalina now supports mapping Locales to character sets, and the new setCharacterEncoding() method on ServletRequest. Much more testing and enhancement is needed in this area.

## Web Application Classloader [Medium Well]

Section 9.6.2 of the Servlet Spec draft describes requirements and suggestions related to the classloader provided to a web application. These requirments are currently followed in Catalina.

## DTD for Servlet 2.3 Application Deployment Descriptor [Medium]

An unofficial version of the DTD for parsing web.xml files is included in Catalina (in the source repository it is at "catalina/src/conf/web_23.dtd"). It will be replaced by the official version when published.

$Id: new_spec.html,v 1.2 2001/01/14 04:26:11 craigmcc Exp $