如:在 jsp 页面引入 css 文件使用以下路径
<link href="/css/bootstrap.min.css" rel="stylesheet"> <!-- "/"指当前项目下 -->
<link href="css/bootstrap.min.css" rel="stylesheet">
假设当前访问 jsp 页面是:http://localhost:8080/demo/test.jsp
加"/“代表 绝对路径,是从站点的根目录开始找,即:http://localhost:8080/css/bootstrap.min.css
不加”/"代表 相对路径,是从当前路径开始找,即:http://localhost:8080/demo/css/bootstrap.min.css