Servlet technology 4_Servlet life cycle

Servlet program execution sequence:

  1. Execute Servlet constructor method
  2. Execute init initialization method
  3. Execute the service method
  4. Execute destroy method

The first and second steps are when the first visit, the creation of the Servlet program will call

Step 3. It will be called every time you visit

Step 4, called when the web project is stopped

Guess you like

Origin blog.csdn.net/weixin_45024585/article/details/108855359