NOTE
Servlet
Servlet lifecycle: init, service, destroy, garbage collection, and a reference.
This is a historical learning note and may contain outdated or incomplete understanding.
Lifecycle
-
Call
initfor initialization.It is called only once, when the Servlet is created for the first time.
-
Call
serviceto process client requests.This method is called for every client request, and then calls
doGet,doPost, and so on. -
Call
destroyto terminate.It is called only once.
-
Garbage collection.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub