File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes request - service() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "request - service()" Watch "request - service()" New topic
Author

request - service()

kalle suresh
Ranch Hand

Joined: Nov 20, 2007
Posts: 48
When the request comes, service method of which class will be called by the container

1. service(HttpServletRequest, HttpServletResponse) - HttpServlet Class
2. service(ServletRequest, ServletResponse) - Generic Servlet Class

If container uses 1 (HttpServlet Class) method then, is it necessary for the container to convert the response object into an HTTP response
Bod Toki
Ranch Hand

Joined: Sep 01, 2006
Posts: 95
GenericServlet:service(ServletRequest request, ServletResponse response) gets called first, then passes the request to HttpServlet:service(HttpServletRequest request, HttpServletResponse response).

Note that GenericServlet:service() is public, while the HttpServlet:service() and the doXXX() methods are protected.

If container uses 1 (HttpServlet Class) method then, is it necessary for the container to convert the response object into an HTTP response


I'm not sure of what you mean by this.
kalle suresh
Ranch Hand

Joined: Nov 20, 2007
Posts: 48
Hi, In HFSJ
the diagram on page 43 (container converts the response object into an HTTP response )
and
the explanation on page 100 (the service method from the HttpServlet runs)

are contradicting.

If container uses 1 (HttpServlet Class) method then, is it necessary for the container to convert the response object into an HTTP response (Page 43).

Anyone can explain me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request - service()