This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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: 1665
    
  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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: service() method in GenericServlet & HttpServlet