相对路径和绝对路径的解释

适用于html中请求地址的理解

    <!--
    相对路径:
        相对于当前访问地址,后加上自己要访问的地址 (../可以用于删除一级目录,即返回上层目录)
    绝对路径:
        相对于在http://ip:port/,后加上自己要访问的地址
    -->


    <!--  原地址: http://localhost:8080/Servlet/first/second/3.html-->

    <!--  点击后: http://localhost:8080/Servlet/index.jsp-->
    相对路径地址跳转:<a href="../../index.jsp">返回首页</a>
    <br>
    <!--  点击后: http://localhost:8080/Servlet/first/second/index.jsp-->
    相对路径地址跳转:<a href="index.jsp">返回首页</a>
    <br>
    <!--  点击后:http://localhost:8080/Servlet/index.jsp-->
    绝对路径地址跳转:<a href="/Servlet/index.jsp">返回首页</a>
    <br>
原文地址:https://www.cnblogs.com/shmebluk/p/13450010.html