I've looked at the configuration again and again. The web.xml has a servlet mapping set up to the right class. I tested it by changing the servlet-class name, and it errored out. Likewise I changed the URL pattern and it errored out. When running the URL, all I get is a black page. No exception, no stack trace and strangely, the System.out statements I placed within init(config) and service(req,res) too aren't displaying. I also placed the System.out in a static block within the servlet but its not outputting those stmts. Could it be that the problem is within HttpServlet? I placed the System.out stmts before super.init(config) too. How should I debug it. Please help.
Without seeing your web.xml entry for this servlet and the URL with which you are calling it, it is not clear that you are really addressing the servlet correctly.
Once you are sure that the web.xml is indeed mapping to your servlet, the next step is always to ensure that init() is being called. I would not put any system out println before the super.init() call.