It works because the service method looks at the request, and then dispatches it to doGet, doPost, etc. as appropriate. It's quite possible that different things should happen depending on whether it's GET, POST, HEAD, or any of the other HTTP methods.
hi, How come it will work if you replace your doPost method with service method if you are extending HttpServlet Class?? If you extend GenericServlet, it will work.. please correct me if i am wrong!! krishna.