since TestServlet is extending HttpServlet, so is override. when subclass has a method which has the same method signature as in the super class, it is override's definition. in this case, if TestServlet defines its own service(HttpServletRequest, HttpServletResponse) then you need to be careful whether you want your do***() to be called. [ September 27, 2002: Message edited by: Kyle Tang ]
Hello Kyle, Thanks for your prompt response. I was thinking as the same way as you explained. I got confused when I followed the discussion on the following thread where it says:
Keep in mind too that the service method in the code is overloading the public method it gets from its HttpServlet. The public method in HttpServlet takes a ServletResponse and a ServletRequest as its parameters not HttpServletResponse and HttpServletRequest. All the public method does is dispatch the request to the protected method after converting the request and response objects to Http objects. So, in reality, the method in the code posted will never be called, but the method it overloads will be, along with the protected method the servlet will inherit from HttpServlet.