The difference between Terminate and Stop the server

1. Problem: When developing a background system locally, sometimes the server is stopped and then started, requiring the background user to log in again, but sometimes it is not necessary to log in again

2. Solution: When stopping the service, click the stop the server button under servers instead of clicking Terminate under the console

3. Reason: By default, tomcat enables serssion persistence, and our background login information is saved in the session. If you click to stop the server normally, it will call the destroy() method of the servlet and save the session in In a local file (provided that there is content in the session), the file exists under the project name of Catalina's localhost of Tomcat's work

And if you click Terminate, the service will be stopped directly and the destroy() method will not be called 

This is also reflected in the eclipse use help document:

Guess you like

Origin blog.csdn.net/l1509214729/article/details/81354069