This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In order to disable an deployed application i.e.stop receiving request,I am using the Manager web application. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/manager-howto.html But I find that when I restart the server the web application accepts request => the stopping of application is temporary. I want the web application not to receive requests over server restarts. How do I do that?
I think what you're really looking for is to 'undeploy' the application. Remove it entirely from the view of Tomcat, and it won't start.
Be careful using the Manager app to 'remove' an application!!! It will *delete* (in an unrecoverable way) the entire folder containing your deployed web app. This is not such a big deal if you've got a backup somewhere else.
Otherwise, you could set up a Filter that maps to all request (/*). The filter could check some "other area" to determine whether to respond to requests (pass it along the chain) or whether to 'drop' it (simply return, or optionally show a 'not available' page).
The "other area" can be anything like a database, a file, etc. This 'other area' can be programatically accessed.