Question - Explain the Servlet Life Cycle.
Answer -
One of the most striking features of servlets is the Servlet Life Cycle. This is a powerful mixture of the life cycles used in CGI programming and lower-level NSAPI and ISAPI programming.
The CGI has certain resource and performance problems. In low-level server API programming, there are some security concerns as well. These are addressed by the servlet engines by the servlet life cycle. A servlet engine might execute all of its servlets in a single Java virtual machine (JVM). Servlets can efficiently share data with each other as they share the same JVM. Still, they are prevented from accessing each other’s private data by the Java language. Additionally, servlets can be permitted to remain between requests as object instances. Thus they take up lesser memory than the complete processes.