如何包含来自另一个文件夹的 JSP 文件 [英] How to include JSPs file from another folder

查看:36
本文介绍了如何包含来自另一个文件夹的 JSP 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

How can include JSPs file from another folder: My hierarchy is WebContent/WEB-INF/JSPs/..

My JSP file to be include is from /WebContent/WEB-INF/JSPs/body/content.jsp and the JSP file where will i include the file is /WebContent/WEB-INF/JSPs/header/navigation.jsp

What i tried so far is:

  1. <jsp:include page="../JSPs/header/navigation.jsp"></jsp:include>
  2. <jsp:include page="/WebContent/WEB-INF/JSPs/header/navigation.jsp"></jsp:include>

解决方案

Your relative path is wrong. Use:

<jsp:include page="../header/navigation.jsp"></jsp:include>

这篇关于如何包含来自另一个文件夹的 JSP 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆