项目ProjectXXX目录如下:

WebContent>

  hello.jsp

    Folder1>

      foo.jsp

      Folder2>

        foo2.jsp

在foo.jsp中访问hello.jsp:href="..\hello.jsp"

在foo2.jsp中访问hello.jsp:href="..\..\hello.jsp"

 

当然,也可以直接使用绝对路径:href="/hello.jsp",这个方法对foo.jsp和foo2.jsp都适用,前提是你在server.xml中配置类似于<Context path="/ProjectXXX" docBase="D:\...\ProjectXXX\WebContent"/>

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2021-11-27
猜你喜欢
  • 2021-11-27
  • 2022-12-23
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案