Bookmark Topic Watch Topic
  • New Topic

Servlet ingheritance property  RSS feed

 
Josweth Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please clarify my doubt in servlets,go through below the statements .

Here is the process what I know in servlets,

1.The browser sends a request to the servlet which is called MyServlet and extends HttpServlet

2.The server generates request and response objects and sends these objects to the service() method of MyServlet,which contains doPost() but not service().

3.So the requet sends to the service() method of HttpServlet(Super class of MyServlet)

4.Then the service() method internally calls the doGet or doPost() of MyServlet.



Here is my doubt

--->> How the service() method of HttpServlet(Super class) invokes doGet or doPost() of MyServlet(Subclass)???. I think it voilates the inheritance property.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can you be more specific about how this "voilates the inheritance property"?

(I think this is really a question about polymorphism rather than Servlets, but I'm not clear on what's being asked.)
[ December 29, 2005: Message edited by: marc weber ]
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Report post to moderator
Already answered in Servlet Forum
Do not ask same questions at multiple places..

Shrinivas
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by Shrinivas Mujumdar:
Already answered in Servlet Forum
Do not ask same questions at multiple places..


In addition, similar thread found here.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!