Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Default implementation of service method in HttpServletClass

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are your answers? What is your level of confidence in them?
 
Manish Shinde
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry !! i didn't get you?
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic