how to handle error in ServletContextListener

V

vk02720

I am trying to initialize my webapp using ServletContextListener.
How do I inform the Tomcat container that there was an error in
contextInitialized() and hence not to make my webapp available ?

I am using Struts in my webapp. Is it a good idea to do initialization
using ServletContextListener or plug-in mechanism of struts ?

TIA
 
W

Wendy Smoak

vk02720 said:
I am trying to initialize my webapp using ServletContextListener.
How do I inform the Tomcat container that there was an error in
contextInitialized() and hence not to make my webapp available ?

http://www.mail-archive.com/[email protected]/msg114792.html

- throw any RuntimeException
- Set an Attribute in the request and have a Filter that checks for it and
redirects to a 'not available' page.
I am using Struts in my webapp. Is it a good idea to do initialization
using ServletContextListener or plug-in mechanism of struts ?

I would prefer the ServletContextListener just because it's part of the
Servlet spec and more people will be familiar with it than the
Struts-specific Plugin mechanism.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top