Originally posted by Rauhl Roy:
...
In other words, without writing the main method we are able to run the servlet program. why is it possible throgh servlets ?
There is a main method but it's not in the servlets themselves.
It's in the code for the container. Once started, it runs continuously, waiting for HTTP requests. When it receives one, as Gregg said, it instanciates a servlet to handle it.