I want to have some code executed whenever my web-app deploys.
The same should happen if I re-start tomcat.
And this should be done only once in the life-cycle of the entire web-application.
Is there something which I can set in web.xml, something like a startup entry, which will be executed everytime I deploy my web-application or restart tomcat ?
Please help.
You need to implement
ServletContextListnerinterface.ServletContextListneris insidejavax.servletpackage.Here is a brief code on how to do it.
And configure it in your deployment descriptor web.xml