• 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

service() method in GenericServlet & HttpServlet

 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, GenericServlet has

service(ServletRequest, ServletResponse) method

HttpServlet(extends GenericServlet ) has

service(ServletRequest, ServletResponse) method and
service(HttpServletRequest, HttpServletResponse)

What is the use of service(ServletRequest, ServletResponse) method in HttpServlet ?
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What is the use of service(ServletRequest, ServletResponse) method in HttpServlet ?


This can actually be found in the API:

Dispatches client requests to the protected service method.


The service(ServletRequest, ServletResponse) method of the GenericServlet class is an abstract method, so it has to be implemented by the first concrete class in the hierarchy (down the tree). For the HTTP protocol this is done in the HttpServlet class. All the client requests are directed to the public service(ServletRequest, ServletResponse) method, which dispatches them to the protected service(HttpServletRequest, HttpServletResponse) method from the HttpServlet which dispatches them to the doXXX methods defined in the HttpServlet.

Regards,
Frits
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic