How to include JSPs file from another folder
22,471
Solution 1
Your relative path is wrong. Use:
<jsp:include page="../header/navigation.jsp"></jsp:include>
Solution 2
You should use jsp include tag as shown below from any jsp file.
<jsp:include page="/WEB-INF/JSPs/header/navigation.jsp"></jsp:include>
<jsp:include page="/WEB-INF/JSPs/header/navigation.jsp"></jsp:include>
Author by
user2785929
Updated on July 12, 2022Comments
-
user2785929 almost 2 years
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:
<jsp:include page="../JSPs/header/navigation.jsp"></jsp:include>
<jsp:include page="/WebContent/WEB-INF/JSPs/header/navigation.jsp"></jsp:include>