How does the Tomcat server clean up the cache?

Tomcat is popular among programmers because of its open source, free, low system resources, good scalability, support for load balancing and mail services and other common functions of development application systems. How to clean up the tomcat server cache?


Tomcat is a core project in the Jakarta project of the Apache Software Foundation, developed by Apache, Sun, and other companies and individuals. With the involvement and support of Sun, the latest Servlet and JSP specifications are always reflected in Tomcat, and Tomcat 5 supports the latest Servlet 2.4 and JSP 2.0 specifications. Because of its advanced technology, stable performance, and free of charge, Tomcat is loved by Java enthusiasts and recognized by some software developers, becoming the most popular web application server. The latest version is 7.0.


Cleaning up the server cache can eliminate some unknown errors. If you run the previously compiled project wrong and do not clean up the server cache in time, the error may still occur in the new project: therefore, it is necessary to clean up the cache:


Step / method


First open Myeclipse8.5, here I am using Myeclipse8.5, so the 8.5 version to explain: If you are using Eclipse or Myeclipse, you can still use this method:


the first method


Step 1: Open a project, here I open the Mail project, and then click project-select clean in the Myeclipse menu bar: as shown below:

4841428_20140527163752[1].png

Step 2: Click here to save the cache directly without entering the tomcat server.


Although the above method is simple, but it is still not able to completely clean up the tomcat cache.


The second method


Step 1: Enter the installation directory of tomcat to clean up the cache. Here I use tomcat6.0. The tomcat used is free of installation. After decompressing, I recommend that you use this version instead of the installation version. If you use It is the installation version, and the method is exactly the same as the decompression version.

4841428_20140527163812[1].png

Step 2: Then click into the unpacked tomcat and find the work folder. There is a catalina directory under this file (tomcat is called catalina), and files in the work directory can be deleted.

4841428_20140527163842[1].png

Step 3: There is a catalina directory in the work directory. After deleting the tomcat directory in the work, the cache has been deleted.

4841428_20140527163854[1].png

Step 4: If one of our previously released projects is wrong, everyone knows that the project released by tomcat is under webapps. If the previous project is wrong, then running the new project will definitely be wrong. The mistakes left by the previous project, at this time, just delete the previous project.

4841428_20140527163908[1].png

Step 5: Enter webapps to delete the previously left-old items. You can also empty all the items. Because there are previous items in Myeclipse's workspace, we only need to re-publish. The workspace will be in the tomcat webapps directory. The items in the project are automatically reloaded into webapps. Is it very convenient?