如何包含另一个文件夹中的JSP文件:我的层次结构是WebContent / WEB-INF / JSPs /。
我要包含/WebContent/WEB- INF/JSPs/body/content.jsp的JSP文件来自,我将包含该文件的JSP文件是/WebContent/WEB- INF/JSPs/header/navigation.jsp
/WebContent/WEB- INF/JSPs/body/content.jsp
/WebContent/WEB- INF/JSPs/header/navigation.jsp
到目前为止,我尝试过的是:
<jsp:include page="../JSPs/header/navigation.jsp"></jsp:include>
<jsp:include page="/WebContent/WEB-INF/JSPs/header/navigation.jsp"></jsp:include>
你的相对路径是错误的。采用:
<jsp:include page="../header/navigation.jsp"></jsp:include>