---
title: "\"/\"路径的使用"
author: "explore"
date: "2010-07-21T22:54:11Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-07-21T22:54:11Z"
id: 718331
url: "https://explore.iteye.com/blog/718331"
---

在本机搭建一个Web项目，项目名为：demo,浏览器中输入:http://localhost:8080/demo可访问主页

 

1.服务器端的"/"代表[http://localhost:8080/demo](http://localhost:8080/demo)，如spring中的配置文件中用到的，java代码中用到的

2.客户端的"/"代表[http://localhost:8080](http://localhost:8080)，包括html,css,jsp中没有使用java代码的部分

3.假如现在浏览器地址栏中的链接是：[http://localhost:8080/demo/crm/dashboard.htm](http://localhost:8080/demo/crm/dashboard.htm),

页面上有一链接地址为:&lt;a href="product.htm"&gt;test&lt;/a&gt;,点击这个地址后，浏览器中的地址会变为[http://localhost:8080/demo/crm/product.htm](http://localhost:8080/demo/crm/product.htm)，即只取代最后一个反斜杠后面的部分.