What is the difference between / ./ ../ ../../ in web projects?

"/" root directory, locate the server root directory (localhost:8080/) in the web project. In the jsp file in the web project, the current directory
in any jsp is the root directory of the project. "./" current directory, locate the project The root directory, for example, if the project name is hello, locate the localhost:8080/hello/ directory ". ./" The upper-level directory of the current directory, locate the parent directory of the current directory. Locate the localhost:8080/hello/ directory, whose parent directory is the server root directory.

Try not to use relative paths in web projects, as problems may easily arise when the project is modified or migrated.

Try to use absolute paths in web projects. Start locating directly from the project root directory (for servers) or server and directory (for users).

In the jsp file:
"" Project root path
"/" Server root path
"./" Project root path
". ./" Server root path

Guess you like

Origin blog.csdn.net/weixin_40307206/article/details/105846444