This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes let me get this straight.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "let me get this straight...." Watch "let me get this straight...." New topic

let me get this straight....

Jimmy Blakely
Ranch Hand

Joined: Jul 10, 2001
Posts: 57
Am I correct in concluding that...

When a HttpServlet receives a request, the object's service(ServletRequest request, ServletResponse response) method is called (inherited from GenericServlet) and that method in turn calls the object's service(HttpServletRequest request, HttpServletResponse response) method.
In essence, the method would look like this...
public void service(ServletRequest request, ServletResponse response) throws IOException, ServletException
service((HttpServletRequest)request, (HttpServletRespose)response); // object casting
Am I on the right track?
Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
hi jimmey,
yeah u r on the right track...whenever a request is made the service method of the Generic Servelet class is called , then if its a HttpServlet the service method has to be overridden by HttpServlet's service( public/protected)which in turn calls either the doGet/doPost as per the mode of request.
It is sorta covered in the JavaRanch Style Guide.
subject: let me get this straight....
Similar Threads
service method in HttpServlet
Question Bank ID : 6
What is the order of execution???
service() method in GenericServlet & HttpServlet
request - service()