This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Default implementation of service method in HttpServletClass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Default implementation of service method in HttpServletClass" Watch "Default implementation of service method in HttpServletClass" New topic
Author

Default implementation of service method in HttpServletClass

Manish Shinde
Ranch Hand

Joined: Mar 30, 2011
Posts: 39
HtttpServlet is an abstract class with no abstract methods that means each method in the class has its default implementation.

In that case :
1)what is Default implementation of service(ServletRequest req, ServletResponse res) method in HttpServlet Class.
2)Is the following flow correct for calling methods in HttpServlet Class?
I) container calls service(ServletRequest req, ServletResponse res) method.
II) then from above method
protected void service(HttpServletRequest req, HttpServletResponse resp) method will be called
III)After depending on request type doGet() or doPost() method will be called form
protected void service(HttpServletRequest req, HttpServletResponse resp)


Thank You.
Manish
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

What are your answers? What is your level of confidence in them?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Manish Shinde
Ranch Hand

Joined: Mar 30, 2011
Posts: 39
sorry !! i didn't get you?
Jeff Ishar
Greenhorn

Joined: Jul 04, 2011
Posts: 13
Hello Manish,
Your Method calling sequence is correct. why would you like to know the default implementation of the service method in HttpServlet? Thats why Sun recommends you to extends the class and avoid any errors or mistakes in writing service method yourself.

Hope this helps


Cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Default implementation of service method in HttpServletClass
 
Similar Threads
service method...
which service() method is called
Why the service methods in HttpServlet abstract class are protected?
about protected void doGet() ?
pubic and protected service method