当前位置:网站首页>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 .
边栏推荐
- Shuffle Net_ v1-shuffle_ v2
- 正反斜杠笔记
- VS Code 基础配置与美化
- PyTorch 学习笔记
- PyTorch 学习笔记 3 —— DATASETS & DATALOADERS & TRANSFORMS
- Pytorch learning notes
- Cautious speculation about fusion on Apple silicon
- Machine learning note 5 - logistic regression
- ICC2(四)Routing and Postroute Optimization
- A NOVEL DEEP PARALLEL TIME-SERIES RELATION NETWORK FOR FAULT DIAGNOSIS
猜你喜欢

Pytorch learning notes 3 - datasets & dataloaders & transforms

Exploration of Clickhouse aggregation internal mechanism of aggregation

VS Code 基础配置与美化

Shuffle Net_ v1-shuffle_ v2

set_ clock_ groups

qt自定义滑动按钮(美观且使用方便)

What about the insufficient memory of Clickhouse aggregation? Then improve the polymerization performance

Low power design -power switch

qt绘画事件-设置背景图片

ConNeXt
随机推荐
相对路径和绝对路径
QT parse string into JSON data and parse
Systemmediasize startup option added in esxi 7.0 update 1C
自定义组件--纯数据字段&组件的生命周期
Perl入门学习(八)子程序
Paper artifact vs code + latex + latex workshop
Beginners choose sensors
Ship detection in SAR image based on yolov5
保研面试中常见的英语问题有哪些?
【学习笔记】线程创建
【学习笔记】驱动
Find the network address and broadcast address of the host according to the IP address and subnet mask
Graduation thesis | how to write literature review
Why should fluke dsx2-5000 network cable tester be calibrated once a year?
【学习笔记】编码能力
天线效应解决办法
set_multicycle_path
雷达成像 Matlab 仿真 2 —— 脉冲压缩与加窗
[yolov5] environment construction: win11 + mx450
Measure computer battery capacity