What are the advantages of building a small Java web app to run in a Servlet container (like Tomcat) vs. building a standalone Java app with a built-in web server and runnin
if you are having issues with your hot deploy, most likely you aren't cleaning up your external connections or other resources. To handle this, usually you want to implement a listener that will let you know when something is started or stopped.
you should probably in your wars implement something like this (tomcat 6):
public class MyTomcatInitCleanupListener implements ServletContextListener
{
@Override
public void contextInitialized(ServletContextEvent arg0)
{
super.contextInitialized(arg0);
}
@Override
public void contextDestroyed(ServletContextEvent arg0)
{
super.contextDestroyed(arg0);
}
}
for tomcat 7+, you can google "tomcat lifecycle listener"