Is there a way to prevent the context from starting up if a servlet init() call throws an exception or otherwise fails?

Here's the situation: we have a utility servlet that loads first (using <load-on-startup>) and accesses some external resources, checks database connections, etc. Then our main application servlet loads. In the case where the external dependancy fails, the context still comes up and fails at a later point. It would be better practice to have the context load fail when our utility servlet init() method throws it's exception.

I was thinking that there might be something in ServletContext that would allow the servlet to force the context to dump out. Or perhaps a call to System.exit(1) would be appropriate.

I'd really appreciate some advice. Thanks.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to