NOTE
Servlet
A Servlet calls init after creation and service for requests, dispatching to methods such as doGet and doPost. These notes organize the lifecycle.
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.
Reference
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub