天天看點

meta标簽自動跳轉和超連結指定位址的差別

首先說明各個檔案之間關系:

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" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>2.jsp //相對于項目根目錄下的

2.從1.jsp-->servlet A

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

超連結:<a href="servlet/A" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>servlet A

3.從3.jsp-->1.jsp

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

超連結:<a href="work1/1.jsp" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>1.jsp

4.從3.jsp-->2.jsp

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

超連結:<a href="work2/2.jsp" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>2.jsp

5.從1.jsp-->3.jsp

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

超連結:<a href="work1/work3/3.jsp" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>3.jsp

6.從3.jsp-->servlet A

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

超連結:<a href="servlet/A" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>servlet A

而chrome浏覽器則做的比較一緻:都是相對于項目根目錄下面的

1.從1.jsp-->2.jsp

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

超連結:<a href="work2/2.jsp" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>1.jsp

2.從1.jsp-->servlet A

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

超連結:<a href="servlet/A" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>servlet A

3.從3.jsp-->1.jsp

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

超連結:<a href="work1/1.jsp" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>1.jsp

4.從3.jsp-->2.jsp

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

超連結:<a href="work2/2.jsp" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</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" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>3.jsp

6.從3.jsp-->servlet A

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

超連結:<a href="servlet/A" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >轉到</a>servlet A