Mike,
Doing this with pure J2EE Servlet code, I would use three components.
First, use the Context Listener to check the Database on start up, if no
DB connectivity set a ApplicationContext attribute to that effect. The
second part would be a javax.servlet.Filter which checks the status of
ECTED]
Sent: Monday, September 26, 2005 1:22 PM
To: Tomcat Users List
Subject: Re: Options to prevent web app from being available if DB not
available?
Servlet filter.
The filter can check the database status on init. Then the filter could
be
made smart enough to let all traffic through if the database
Haven't really thought it through as I just woke up :-)
However, I don't see why couldn't write a filter that filters all request.
It checks the DB connection and if it isn't there it just simply forwards
the user to an appropriate page.
As to making the whole web app unavailable - I am not sure
Servlet filter.
The filter can check the database status on init. Then the filter could be
made smart enough to let all traffic through if the database comes back to
life. (or conversely also goes away)
-Tim
Mike Miller wrote:
Hi,
I am looking for options to prevent my web application fr