Or does it only mark that Servlet as unavailable? Throwing a
RuntimeException from the contextInitialized() method of a
ServletContextListener will mark the context as unavailable.
Use of a ServletContextListener to do app initialization is probably the
way to go instead of load-on-startup servlets.
my $0.02,
Jon
Mike Curwen wrote:
> I think if you throw a RuntimException, then Tomcat will mark the app as
> unavailable.
>
>
>
>>-----Original Message-----
>>From: Adrian Beech [mailto:a.beech@(protected)]
>>Sent: Sunday, January 18, 2004 5:35 AM
>>To: tomcat-user@(protected)
>>Subject: Terminating or suspending an application if a "on
>>start up" servlet throws an exception?
>>
>>
>>G'day,
>>
>>Is it possible to have Tomcat 4.1.x terminate or suspend
>>access to an application if a servlet which is fired at start
>>up throws an exception? For example, we have two servlets
>>which are loaded on start up. The first one sets up the
>>database connection pool and the second one does various
>>other application initialisation type actions. If either one
>>throws an exception then I'd like the application to be unavailable.
>>
>>Can this be done? If so then how?
>>
>>AB
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)