You can see the following illustration to better understand the lifecycle of the Servlet.
![](https://o7planning.org/en/10169/cache/images/i/788727.png)
When the request of users to Servlet, the servlet will call the method of service() to serve the requirements of users, the service() will call either doGet() or doPost().
![](https://o7planning.org/en/10169/cache/images/i/796098.png)
The figure below illustrates how WebContainer decided to use Servlet to service request from the client.
![](https://o7planning.org/en/10169/cache/images/i/900091.png)
https://o7planning.org/en/10169/java-servlet-tutorial