Servlet program execution sequence:
- Execute Servlet constructor method
- Execute init initialization method
- Execute the service method
- 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