9. Servlet Interview Questions
|| Servlet Interview Questions || 1. What is servlet? Servlet is a server side programming language which is used for generating dynamic web pages. It generates web-page as a response of the request received from client(browser). 2. Static webpage vs Dynamic webpage? The webpages which are same for all the users are static webpages and the webpages that are dynamically generated based on the user’s request (that may be different for each user depending on the request) are known as dynamic webpages. Servlet is mainly used for dynamic webpages. 3. Life cycle of a servlet? Following the the stages of servlet life cycle: 1) Loading of Servlet class: The servlet container finds the servlet class mentioned in web.xml file and loads it. 2) Servlet instantiation: The object of servlet class gets created in this phase. 3) Initialization: Servlet initialization by calling init() method. 4) Servicing the request: In this phase the servlet service the client request by calling the service() me