2627282930313233343536
@Override public void contextInitialized(ServletContextEvent sce) { if(mythread==null || !mythread.isAlive()){ mythread = new MyThread(); mythread.setMyServlet(re); mythread.setDaemon(true); mythread.start(); }