Suppose you try to create an application resource in a
ServletContextListener and the attempt fails. For example, you might try
to create a database connection pool only to find that the database is
unavailable. In a servlet, you could throw an UnavailableException. The
listener methods don't throw exceptions at all, but you still want to
mark the application as unavailable.

One possibility might be to set up a request filter which checks for
some application context attribute (for example, an exception object
thrown by the connection pool) set by the context listener and fails if
it's there. Filters are allowed to throw UnavailableException. You could
map the filter to /* to cover all application requests.

Is there some other method that makes more sense?


Gennis

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to