Mac下Intellij IDea发布Java Web项目详解五 开始测试

时间:2023-01-21 20:01:27

测试前准备工作目录

JavaProject的工程结构

Mac下Intellij IDea发布Java Web项目详解五 开始测试

开始测试下绝对路径

Mac下Intellij IDea发布Java Web项目详解五 开始测试Mac下Intellij IDea发布Java Web项目详解五 开始测试
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>project1/test1/index1.jsp</title>
    </head>
    <body>

        <h1>测试绝对路径</h1>

        <h4>WebWorkSpace1的web页面绝对路径 == (http://+ ip + port) + WebWorkSpace1 Application context(/) + path + *.jsp</h4>
        <h4>project1的web页面绝对路径 == (http://+ ip + port) + WebWorkSpace1 Application context + project1 Application context + path + *.jsp</h4>
        <h4>project2的web页面绝对路径 == (http://+ ip + port) + WebWorkSpace1 Application context + project2 Application context + path + *.jsp</h4>

        <h6>path是*.jsp文件的上级目录,web的下级目录们,如:project1_test1_index2.jsp的path=test1,它在web目录下,包含project1_test1_index2.jsp文件</h6>

        <%--http://localhost:1025/project1/index.jsp--%>
        <a href="http://localhost:1025/project1/index.jsp">project1/web/index.jsp</a><br><br>
        <%--http://localhost:1025/project1/web/test1/project1_test1_index2.jsp--%>
        <a href="http://localhost:1025/project1/test1/project1_test1_index2.jsp">project1/test1/project1_test1_index2.jsp</a></a><br><br>
        <%--http://localhost:1025/project1/web/test2/project1_test2_index1.jsp--%>
        <a href="http://localhost:1025/project1/test2/project1_test2_index1.jsp">project1/test2/project1_test2_index1.jsp</a></a><br><br>
        <%--http://localhost:1025/project2/web/index.jsp--%>
        <a href="http://localhost:1025/project2/index.jsp">project2/index.jsp</a><br><br>
        <%--http://localhost:1025/project2/web/test3/project2_test3_index1.jsp--%>
        <a href="http://localhost:1025/project2/test3/project2_test3_index1.jsp">project2/test3/project2_test3_index1.jsp</a>

    </body>
</html>
View Code

测试绝对路径效果

  • WebWorkSpace1的web页面绝对路径 == (http://+ ip + port) + WebWorkSpace1 Application context(/) + path + *.jsp
  • project1的web页面绝对路径 == (http://+ ip + port) + WebWorkSpace1 Application context + project1 Application context + path + *.jsp
  • project2的web页面绝对路径 == (http://+ ip + port) + WebWorkSpace1 Application context + project2 Application context + path + *.jsp
  • path是*.jsp文件的上级目录,web的下级目录们,如:project1_test1_index2.jsp的path=test1,它在web目录下,包含project1_test1_index2.jsp文件
project1/web/index.jsp
project1/test1/project1_test1_index2.jsp
project1/test2/project1_test2_index1.jsp
project2/index.jsp
project2/test3/project2_test3_index1.jsp