Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

servlets

 
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.
 
Author and all-around good cowpoke
Posts: 13078
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
 
Bartender
Posts: 2856
10
Firefox Browser Fedora 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.
 
Ranch Hand
Posts: 162
Hibernate Spring Java
  • 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: 2856
10
Firefox Browser Fedora 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.
 
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic