相對路徑 ./代表當前路徑 可以省略 ../代表上一級
相對路徑
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>相對路徑</title>
</head>
<body>
<a href="./responseDemo1">相對路徑跳轉</a>
<!--
./可以省略
-->
<a href="responseDemo1">相對路徑跳轉</a>
</body>
</html>
絕對路徑 服務器不需要加虛擬路徑 客戶端要加虛擬路徑
絕對路徑
//重定向 客戶端 需要加虛擬路徑
String contextPath = req.getContextPath();
resp.sendRedirect(contextPath+"/responseDemo2");
...