• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

service() method in GenericServlet & HttpServlet

 
Harikrishna Gorrepati
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 ?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2422
95
Android Chrome Eclipse IDE
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic