On Wed, 24 Jul 2002, Extance, Paul wrote:

> Date: Wed, 24 Jul 2002 12:12:54 -0700
> From: "Extance, Paul" <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: How to abort the webapp load/deployment
>
> Hello,
>
> Is it possible to write a 'validation' servlet, that does some basic checks,
> which if fail, cause the whole web application to be unavailable?
>

You can accomplish this for a particular servlet by throwing an exception
from the init() method, but there is no portable mechanism to do this for
an entire webapp.

Conceptually, throwing an exception from a configured listener class (like
a ServletContextListener.contextStarted() method) would make sense.  More
formal definition of the semantics of this is under discussion for Servlet
2.4.

> This servlet would be flagged as <load-on-startup> such that it was the
> first one to execute.
>
> I'm trying to achive something similar to JBoss 2.x where if the verifier
> fails for an EAR, it does not deploy it at all. I want the similar concept
> but for my Web Application, such that critical initialization errors make
> the the whole application unavailable.
>
> I can't find anythingin in the Java Servlet Spec to indicate that this is
> possible, or anything in the tomcat documenation.
>

In Tomcat 4.0.x and 4.1.x, throwing an exception from contextStarted()
will indeed abort the deployment of that webapp, but this is Tomcat
specific.

> Thoughts?
>
> Thanks
>
> PaulE
>

Craig


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


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

Reply via email to