我的JSP文件访问路径怎么不对呢?

村北头的码农
人工智能领域新星创作者
2004-10-26 06:48:34
<%@ include file="../include/header_root.inc.jsp"%>
用来访问include文件夹下的header_root.inc.jsp文件,可上句放在data文件夹一个文件中,结果报错:
org.apache.jasper.JasperException: /weishan/data/Product.jsp(207,0) File "/weishan/data/include/footer_root.inc.jsp" not found
header_root.inc.jsp文件是放在/weishan/include/footer_root.inc.jsp。请问怎样修改
<%@ include file="../include/header_root.inc.jsp"%>才能访问正确路径?
...全文
195 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
村北头的码农 2004-10-26
  • 打赏
  • 举报
回复
to: tutor666(小虫)
org.apache.jasper.JasperException: /weishan/data/Product.jsp(3,0) File "/weishan/data/../../include/header_root.inc.jsp" not found


实际文件在/weishan/include/header_root.inc.jsp。
村北头的码农 2004-10-26
  • 打赏
  • 举报
回复
header_root.inc.jsp的路径为../include/header_root.inc.jsp
访问文件所在路径:../data/use.jsp
use.jsp文件中<%@ include file="../include/header_root.inc.jsp"%>
来访问header_root.inc.jsp。您这个
<%@ include file="/xxx/.../xxx/include/header_root.inc.jsp"%>.能不能详细一下,到底该怎么写啊?
tutor666 2004-10-26
  • 打赏
  • 举报
回复
<%@ include file="../../include/header_root.inc.jsp"%>
zhuxr2004 2004-10-26
  • 打赏
  • 举报
回复
用<%@ include file="/xxx/.../xxx/include/header_root.inc.jsp"%>.
其中根目录指web地址的起始路径.比如index.jsp的所在路径.

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧