Here are three ideas: Modify the context loader to catch the exception, and add a servlet/mapping to the container the that redirects all the relevant mappings to the dynamically loaded servlet. Check out this stack overflow thread of instructions on how to create a dynamic servlet: Dynamically add a servlet to the servletConfig Alternatively you could have a standard servlet defined that handles all requests and forwards them to the config page. You can then have a spring bean that remove thats servlet and mapping from the context when it's finished initalizing (you might want to put that code in the postInitalize hook of a spring bean.) You could also try creating a listener that checks to see if a valid application context exists and removes a "default" mapping /servlet exits.
I don't think there are standard mechanisms for adding/removing servlets and mapping from the container. But it looks like most containers have some APIs that do this. There is a third way, which you were hinting.
Which is to assume that if a 404 error occured then servlet failed to start. If you go down that route I think you will run into the issue that 404 errors can occurs just because the user fat fingered the url.
Great post.. I will let you know what I going to implement and how it works – michel May 2 at 6:55 1 I want to let you know that is implemenents an whole other solution. I start with a default web. Xml and after the setup is done I replace the web.
Xml with the application web.xml. Because the web. Xml is replaced the servers restarts.
This works great. Thanks again for your answer. – michel May 11 at 7:05 @michel that's a good idea.
I'll keep it in mind. Thanks for the update – Karthik Ramachandran May 11 at 14:45.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.