Class 2 |
Intermediate Java 30-IT-397 |
|
The Servlet Life Cycle
-
A servlet gets created only once. Additional requests result in a
new thread that calls doGet() or doPost().
-
A typical servlet life cycle is:
-
init() The first time a servlet is invoked, init is called to initialize
parameters.
-
service() This method calls doGet() or doPost(), as appropriate.
-
destroy() The final method called, when the servlet is unloaded.
init()

Created by: Brandan Jones
December 20, 2001