当前位置:网站首页>Relative path and absolute path
Relative path and absolute path
2022-07-28 06:31:00 【wr_01】
Slashes and dots indicate relative and absolute paths
Absolute path : It's the path from the drive letter
Relative paths : Is the path starting from the current path
/ It's the root directory ( stay Javaweb Can be combined with the absolute path inside the project as a relative path )
./ Is the current directory ( Or start with nothing )
“…/” To represent a higher level directory ,
Absolute path
JavaWeb Relative path in
Relative paths are divided into paths that start with a diagonal bar and paths that do not start with a diagonal bar
- Path starting with diagonal bar : Baseline path ( The root path ) Relative path of
- A path that does not begin with a diagonal bar : The relative path of the current directory
Depending on the location of the file where the path is located , Divided into two : Foreground path and background path .
A、 Foreground reference path
The so-called foreground path refers to , The path contained in the code executed by the browser .
for example ,html、css、js In the path , And jsp The path of the static part in .
image html And jsp In the static part of <img src=" "/>、<a href=" "></a>、<form action=" "></form> etc. ; image css Medium background:img("") etc. ; image js Medium window.location.href=" " etc. , All belong to the foreground path .
The reference path of the foreground path is Web The root path of the server , namely http://127.0.0.1:8080/
B、 Background reference path
The so-called background path refers to , The server parses the executed code and the path contained in the file .
for example ,java The path in the code 、jsp File dynamic part (java Code block ) In the path 、xml Path in file (xml The document is to be java The code is loaded into memory , And by the java Code parsing ) etc. .
The reference path of the background path is Web Root path of application . Such as http://127.0.0.1:8080/primary/ (primary yes Web Applied project name )
HTML and JSP Benchmark difference of relative path
In the default HTML Page and JSP The benchmark of relative path in the page is different .
stay HTML in base The label is used to know the benchmark of the relative path ( default HTML Page does not base label , At this time, the relative path is the path relative to the current page )
stay jsp It automatically adds one to us base Label and specify that the benchmark is the project path , Therefore, the relative path we write in any directory is based on the project path .
边栏推荐
- Fluke dtx-1800 and its accessories dtx-cha002 channel adapter channel replacement RJ45 socket notes
- 自定义组件--数据监听器
- ClickHouse 中的公共表表达式CTE
- ICC2(三)Clock Tree Synthesis
- Perl Introduction (10) formatted output
- T-sne dimension reduction visualization
- Beginners choose sensors
- IP地址的五大分类
- PyTorch 学习笔记 2 —— About Tensor
- Pytorch learning note 4 - automatic calculation of gradient descent autograd
猜你喜欢
随机推荐
相对路径和绝对路径
qt中获取当前目录
NPM yarn related operations
MySQL安装与使用
PyTorch 学习笔记 2 —— About Tensor
JSP实现文件上传功能的同时还要向后台传递参数
Five categories of IP addresses
基于 YOLOV5 的 SAR 图像舰船检测
Efficient Net_ V2
Why should fluke dsx2-5000 network cable tester be calibrated once a year?
qt中Qthread线程的使用以及安全关闭
Vs code basic configuration and beautification
Monitor the CPU temperature of raspberry pie 4B installed with esxi on ARM
Overall understanding of PLC
Matlab simulation of radar imaging 3 - multi-target detection
Redhawk Dynamic Analysis
Exploration of Clickhouse aggregation internal mechanism of aggregation
我的注解笔记
IP地址的五大分类
Talk about the "hybrid mode" of esxi virtual switch and port group









