Explain their methods? Tell me their parameter names also have you used threads in servlet?



Explain their methods? Tell me their parameter names also have you used threads in servlet?..

Answer / Brajesh Kumar Meena

Some common methods of a Servlet are:
1. init(ServletConfig config) - Initialization method called once when the Servlet is first loaded.
2. service(ServletRequest request, ServletResponse response) - The main service method that handles all types of HTTP requests.
3. doGet(HttpServletRequest request, HttpServletResponse response) - Method called to handle GET requests.
4. doPost(HttpServletRequest request, HttpServletResponse response) - Method called to handle POST requests.
5. destroy() - Destruction method called when the Servlet is unloaded.nThreads can be used in Servlets by implementing the Runnable interface and calling the Thread constructor.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Servlets Interview Questions

What is the difference between using getSession(true) and getSession(false) methods?

1 Answers  


What are the phases of servlet life cycle?

1 Answers  


What is the need of servlet filters?

1 Answers  


What are the different mode that servlets can be used?

1 Answers  


How do you configure a centralized error handler in servlets?

1 Answers  


What is the life cycle of a servlet?

2 Answers  


How are filters?

1 Answers  


How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255

1 Answers   Bosch, EF,


how to use servlets with j2ee ?

2 Answers   Tech Mahindra,


what is the difference between ServletContext and ServletConfig

7 Answers  


Explain is servlet mapping?

1 Answers  


What is the use of send redirect () method?

1 Answers  


Categories