/* * MailUpdater.java * * Created on February 27, 2006, 4:10 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package com.persistent.mailtopage; import java.util.Enumeration; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; /** * * @author kiran_thakkar */ public class MailToPage extends HttpServlet{ public void init(ServletConfig config)throws ServletException{ System.out.println("Init method for servlet is called"); try { //get all the parameters passed from web.xml to this servlet. String host = config.getInitParameter("host"); String user = config.getInitParameter("user"); String password = config.getInitParameter("password"); String protocol = config.getInitParameter("protocol"); int timeInterval = Integer.parseInt(config.getInitParameter("timeInterval")); String propertiesFile = config.getInitParameter("propertiesFile"); /call poller to start polling on the account specified. new Poller(host,user,password,protocol,config.getServletContext().getRealPath(propertiesFile),timeInterval); } catch(Exception ex) { ex.printStackTrace(); System.exit(1); } } }