posted 19 years ago
Sashidhar,
Servlets are designed to be invoked to handle an HttpServletRequest. The servlet engine responds to requests by invoking the service method, which delegates to either doGet or doPost depending on the type of HTTP request.
So when we create a servlet we extend the HttpServlet class and typically override the doGet and doPost methods. We may delegate from either of these methods to other methods in our servlet but our servlet would be invoked via the service method invoking either doGet or doPost.
Firstly, methods in a servlet other than those that are being overridden should be private.
Secondly, methods other than those being overridden should only be called within the servlet.
Thirdly, the service method is not designed to be overridden.
I hope this helps.
[ September 23, 2005: Message edited by: Keith Pitty ]