InterviewSolution
| 1. |
Explain the Life Cycle of a servlet. |
|
Answer» A Java class that uses the Servlet Application Programming Interface (API) is a Servlet. The Servlet API consists of many CLASSES and interfaces that define some methods. These methods make it possible to process HTTP requests in a web server-independent manner. A servlet is loaded when a web server receives a request that should be HANDLED by it. Once a servlet has been loaded, the same servlet INSTANCE (object) is called to process succeeding requests. Eventually, the webserver needs to shut down the servlet, typically when the web server itself is shut down. The 3 life cycle methods are:
These methods define the interactions between the web server and the servlet. |
|