title: running periodic task at server side for servlet JSP MVC website
body: <p>I have developed a web application using using servlet and JSP. I am not using any framework per se, instead using my own home brewed MVC framework.  I am using MySQL as a backend. </p>
  
  <p>I want to do the following:</p>
  
  <ol>
  <li>Clean up some data from the data base every hour</li>
  <li>Generate and store statistics about data every 15 minutes in an XML file somewhere</li>
  </ol>
  
  <p>The problem is: currently all my code runs as a result of the request received from a client.</p>
  
  <p>How do I run periodic task(s) at the server side?</p>
  
  <p>One solution I have right now is to creare a thread in the controller's init function.  Are there any other options?</p>