Should I override the service() method?



Should I override the service() method?..

Answer / Avadhesh Kumar Verma

In general, it is recommended to override the service() method only if you need to handle multiple request types (GET, POST, etc.) in a single servlet. If you are handling one type of request, it's often simpler and more efficient to stick with the default implementation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Servlets Interview Questions

What are the methods in HttpServlet?

8 Answers  


What is the difference between Difference between doGet() and doPost()?

1 Answers  


What do you mean by a filter and how does it work?

1 Answers  


Define context initialization parameters.

1 Answers  


How do you design microservices?

1 Answers  


What are the new features added to servlet 2.5?

1 Answers  


How to run a servlet program?

7 Answers   Infosys,


Can threads be used in Servelet?

3 Answers  


How servlets can be automatically reloaded?

3 Answers  


can i call destroy() method in init() method of servlet

9 Answers   Ericsson, IBM,


What is the difference between jsp and servlet life cycle?

1 Answers  


What are different ways for servlet authentication?

1 Answers  


Categories