This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
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

service() method in GenericServlet & HttpServlet

 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • 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: 3348
303
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • 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
 
Get me the mayor's office! I need to tell him about this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic