Explain the working of service() method of a servlet.



Explain the working of service() method of a servlet...

Answer / Ravindra Kumar Upadhyay

The service() method in a servlet is responsible for processing requests from clients. It receives an HttpServletRequest object and returns an HttpServletResponse object. The container decides which service() method to call based on the type of request (GET, POST, etc.). By default, it calls doGet() or doPost(), depending on the request type.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Servlets Interview Questions

What is the difference in between the httpservlet and generic servlet?

1 Answers  


How a servlet is unloaded?

1 Answers  


What is the workflow of a servlet?

1 Answers  


can i call init() method in destroy() method of servlset. ?

5 Answers   IBM,


What are the disadvantages of storing session state in cookies?

1 Answers  


Can a jsp be called using a servlet?

1 Answers  


How do cookies work in servlets?

1 Answers  


What is the difference between Get and Post Method?

12 Answers   T3 Softwares,


What methodology can be followed to store more number of objects in a remote server?

1 Answers  


What are the supporting protocol by HttpServlet ?

1 Answers  


Is java servlet still used?

1 Answers  


What is servletconfig?

1 Answers  


Categories