You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kevin McBrearty <ke...@atg.ca> on 2001/04/08 22:51:31 UTC

ServletUnavailable

I need some advice regarding the following:

I have a servlet loaded through the LoadOnStartup directive in web.xml, and
Tomcat handles it fine. This servlet performs various initializations,
including connection pool setup, etc. If for any reason these
initializations fail I want to handle this gracefully in my main controller
servlet (I am using Velocity).

What is the best way ?

- throw a ServletUnavailable exception in the init() of my controller
servlet ?
- simply show an error page
- how do I detect in the controller servlet that initializations have failed
(set an attribute in the ServletContext within my startup servlet,
indicating whether initializations were successful or not ?)

Any suggestions from someone who has already dealt with this would be
appreciated.

Kevin McBrearty
ATG Automation Technologies Group Ltd.