title: How to run a different thread in a servlet?
body: <p>How do I run a different thread from a servlet? I have the below code in the <code>init()</code> method of the servlet. </p>
  
  <pre><code>FileThread myThread = new FileThread();
  myThread.start();
  myThread.run();     
  </code></pre>
  
  <p>FileThread is supposed to see some folder to check whether files were changed or not. So this thread is made to run in a loop. But it doesn't work as I expected. It freezes (server doesn't return HTML) the service of the server.</p>
  
  <p>I want this thread to run on background and not to interfere with servlet`s process. How can I achive this?</p>