• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlets

 
praveena reddyk
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Syntax of HttpServlet service() method is like overloading the
service() method of GenericServlet so which class is implementing the
service() method of Servlet Interface.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Learn to use the JavaDocs to answer such questions.
Here is one starting point.

Bill
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi praveena reddyk welcome to Javaranch ,
The topic title "servlet" in a forum dedicated to servlets isn't much meaningful. Please make it more descriptive. Read this for more information.

I am not getting your question here, will you please give some details.
 
praveena reddyk
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amit Ghorpade:
Hi praveena reddyk welcome to Javaranch ,
The topic title "servlet" in a forum dedicated to servlets isn't much meaningful. Please make it more descriptive. Read this for more information.

I am not getting your question here, will you please give some details.
 
praveena reddyk
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amit Ghorpade:
Hi praveena reddyk welcome to Javaranch ,
The topic title "servlet" in a forum dedicated to servlets isn't much meaningful. Please make it more descriptive. Read this for more information.

I am not getting your question here, will you please give some details.



Hi Amit,
My question is GenericServlet is having an abstract service() method and HttpServlet class is extending the GenericServlet but the service() method in HttpServlet is having HttpServletRequest and HttpServletResponse as parameters so it is overloading version of GenericServlet service() method. since HttpServlet is defined as abstract it is still having the service() method of GenericServlet without implementation. if we write our own servlet we are overidding the HttpServlet Service() method. so my question is who is implementing the GenericServlet service() method.
 
Kuladip Yadav
Ranch Hand
Posts: 162
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

so my question is who is implementing the GenericServlet service() method.


the answer is HttpServlet.
This class implments service method of GenericServlet


which in implmetation call



And that service method call doGet, doPost etc method.

so dont care about service method HttpServlet will take care of it.

So you have to overrid doGet(), doPost() methods only

See the api
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you can see from the API documentation, service() method in GenericServlet is abstract, so the class extending GenericServlet must implement that method.
For HTTP servlets, the HttpServlet class implements that method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic