tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "eric chacon" <chacone...@hotmail.com>
Subject Re: Correct way to have a servlet exit ???
Date Wed, 09 May 2001 12:43:14 GMT
I don't know if it's safe to call destroy() -- it occurs to me that that 
might be App Server dependent (I'd have to check the spec to be sure).

You might not want to do that though, depending on what the problem was:

If the servlet cannot find a config file, you might want it start up in a 
crippled "report error" mode, where it would direct all requests to an error 
page ("This System is Experiencing Technical Difficulties"), and uses some 
kind of reporting mechanism to alert the administrators.

If the resources it's missing are critical to the entire system (memory, for 
example, or database access), then recovery isn't really an option, and it 
doesn't much matter how you exit an individual servlet.

I've had lots of problems of these kinds (I'm using these IBM-created XML 
servlet classes, where each servlet has an XML config file), and the 
"re-direct-to-the-error-page" system worked pretty well for me.

Cheers,
E.

>From: "Hawkins, Keith (Keith)" <kphawkins@avaya.com>
>Reply-To: tomcat-user@jakarta.apache.org
>To: "tomcat-user" <tomcat-user@jakarta.apache.org>
>Subject: Correct way to have a servlet exit ???
>Date: Wed, 9 May 2001 08:26:43 -0400
>
>
>If a servlet encounters a problem on startup (e.g. can't find a config
>file) how should the servlet gracefully exit?
>
>Is it safe to call its own destroy() method?   Will that confuse/damage
>the servlet container?
>
>-Keith
>
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


Mime
View raw message