You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Extance, Paul" <pa...@spirent.com> on 2002/07/24 21:12:54 UTC

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?

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.

Thoughts?

Thanks 

PaulE

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to abort the webapp load/deployment

Posted by David Mossakowski <dm...@Instinet.Com>.
You can try having a single servlet that has 'handlers' for it and so 
all requests go through it first and it dipatches them further to 
handlers.  I have this setup and map the servlet to something like 
/handler and then for an action such as handler/AuthenticationHandler 
the request goes to 'handler' servlet and it figures out what 
AuthenticationHandler is and if it exists it forwards the request to it.

It works very nice.

d.

Extance, Paul wrote:
> 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?
> 
> 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.
> 
> Thoughts?
> 
> Thanks 
> 
> PaulE
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 


-- 
David Mossakowski              dmoss@instinet.com
Instinet Corporation                 212.310.7275



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to abort the webapp load/deployment

Posted by "Craig R. McClanahan" <cr...@apache.org>.

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

> Date: Wed, 24 Jul 2002 12:12:54 -0700
> From: "Extance, Paul" <pa...@spirent.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: "'tomcat-user@jakarta.apache.org'" <to...@jakarta.apache.org>
> 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:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How to abort the webapp load/deployment

Posted by Mike Jackson <mj...@cdi-hq.com>.
You could uild a MVC app where there are no page accesses
that don't pass through the controller (i.e. index.form and
form is mapped to a servlet which does a requestDispatcher
to index.html or index.jsp).  Have the controller only pass
people through if the validation has occured successfully.

If this is greek I can give you a better example.

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

-----Original Message-----
From: Extance, Paul [mailto:paul.extance@spirent.com]
Sent: Wednesday, July 24, 2002 12:13 PM
To: 'tomcat-user@jakarta.apache.org'
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?

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.

Thoughts?

Thanks

PaulE

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>