标签自动跳转和超链接指定地址的区别

首先说明各个文件之间关系:

servlet A的url:/servlet/A

jsp文件:

项目根目录

work1

work3

3.jsp

1.jsp

work2

2.jsp

 

 

对于firefox浏览器:

 

1.从1.jsp-->2.jsp

自动跳转:<meta http-equiv="refresh" content="3, url=../work2/2.jsp"> //当前文件的相对路径

超链接:<a href="work2/2.jsp">转到</a>2.jsp //相对于项目根目录下的

 

2.从1.jsp-->servlet A

自动跳转:<meta http-equiv="refresh" content="3, url=../servlet/A">

超链接:<a href="servlet/A">转到</a>servlet A

 

3.从3.jsp-->1.jsp

自动跳转:<meta http-equiv="refresh" content="3, url=../1.jsp">

超链接:<a href="work1/1.jsp">转到</a>1.jsp

 

4.从3.jsp-->2.jsp

自动跳转:<meta http-equiv="refresh" content="3, url=../../work2/2.jsp">

超链接:<a href="work2/2.jsp">转到</a>2.jsp

 

5.从1.jsp-->3.jsp

自动跳转:<meta http-equiv="refresh" content="3, url=work3/3.jsp">

超链接:<a href="work1/work3/3.jsp">转到</a>3.jsp

 

6.从3.jsp-->servlet A

自动跳转:<meta http-equiv="refresh" content="3, url=../../servlet/A">

超链接:<a href="servlet/A">转到</a>servlet A

 


而chrome浏览器则做的比较一致:都是相对于项目根目录下面的

 

1.从1.jsp-->2.jsp

自动跳转:<meta http-equiv="refresh" content="3, url=work2/2.jsp">

超链接:<a href="work2/2.jsp">转到</a>1.jsp

 

2.从1.jsp-->servlet A

自动跳转:<meta http-equiv="refresh" content="3, url=servlet/A">

超链接:<a href="servlet/A">转到</a>servlet A

 

3.从3.jsp-->1.jsp

自动跳转:<meta http-equiv="refresh" content="3, url= work1/1.jsp">

超链接:<a href="work1/1.jsp">转到</a>1.jsp

 

4.从3.jsp-->2.jsp

自动跳转:<meta http-equiv="refresh" content="3, url=work2/2.jsp">

超链接:<a href="work2/2.jsp">转到</a>2.jsp

 

5.从1.jsp-->3.jsp

自动跳转:<meta http-equiv="refresh" content="3, url=work1/work3/3.jsp">

超链接:<a href="work1/work3/3.jsp">转到</a>3.jsp

 

6.从3.jsp-->servlet A

自动跳转:<meta http-equiv="refresh" content="3, url=servlet/A">

超链接:<a href="servlet/A">转到</a>servlet A



 

 

 

 

你可能感兴趣的:(meta)