Tomcat deploys the understanding of the virtual directory of the Web project

For a large number of files on the server, it is usually solved by creating a new subdirectory under the main directory of the website, and placing the relevant content in the corresponding directory, but this will take up a lot of memory

Solution: Create a virtual directory. The virtual directory can be a path on a disk or a directory of other computers on the network

Problems solved by virtual directories:
1. Reduce the storage space of Web projects.
2. Solve the problem that Web files must be placed in the root directory of the Web.
3. When multiple URLs access the same file, just point the virtual path to the file. The address is sufficient to avoid multiple copies of the same file
, namely:

http://locathost/demo1/testFiles
http://locathost/demo2/testFiles
http://locathost/demo3/testFiles
http://locathost/demo4/testFiles
http://locathost/demo5/testFiles

Reference: In-
depth understanding of Tomcat virtual directory

Guess you like

Origin blog.csdn.net/HellHellNo/article/details/115371010