• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

servlets

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic