Mike Dunn wrote:

> The DatabaseServlet in the example puts the database (a Hashtable) in the
> ServletContext. It removes it in its destroy method. As DatabaseServlet can be
> unloaded at anytime, why would you remove this global resource at this time
> (potentially prematurely)?
>
> Mike

Under the servlet 2.2 API, there is no graceful way to deal with this.  The
current implementation relies on the behavior of most servlet containers that
leave the servlet in place until the container is shut down.

Under the new servlet 2.3 spec, the API support for application events provides
a *much* better place to do application startup and application shutdown
processing, because you are guaranteed that the listener will be called only at
those two times.

Craig McClanahan


Reply via email to