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 |
What is the difference between using getSession(true) and getSession(false) methods?
What are the phases of servlet life cycle?
What is the need of servlet filters?
What are the different mode that servlets can be used?
How do you configure a centralized error handler in servlets?
What is the life cycle of a servlet?
How are filters?
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
how to use servlets with j2ee ?
what is the difference between ServletContext and ServletConfig
Explain is servlet mapping?
What is the use of send redirect () method?