aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes service() method in GenericServlet & HttpServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "service() method in GenericServlet & HttpServlet" Watch "service() method in GenericServlet & HttpServlet" New topic
Author

service() method in GenericServlet & HttpServlet

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
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 ?


OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1669
    
  25

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
 
Don't get me started about those stupid light bulbs.
 
subject: service() method in GenericServlet & HttpServlet