本文共 435 字,大约阅读时间需要 1 分钟。
jsp中的include标签可以使用相对路径和绝对路径,区别在于路径的第一个字符是否为"/",例如: 假设有如下web路径: webRoot │ │ ├ [jsp] │ │ │ │ │ ├ [subFolder] │ │ │ │ │ subFile.jsp │ │ │ │ │ │ myPage1.jsp │ mypage2.jsp │ │ │ │ │ global.jsp │ │ 相对路径<%@include file="subFolder/subFile.jsp"%> <%@include file="./myPage2.jsp"%> <%@include file="../global.jsp"%>绝对路径
<%@include file="/global.jsp"%> <%@include file="/jsp/myPage1.jsp"%> <%@include file="/jsp/subFolder/subFile.jsp"%>
转载地址:http://xygmi.baihongyu.com/