I have a jsp file in a directory and I am trying to include another file from a directory above. It works fine in localhost, but when the same file is uploaded to server I get the errors.
My Trials:
Trial 1
<jsp:include page="../top_links.jsp" />
Error:
org.apache.jasper.JasperException: An exception occurred processing JSP page /aboutus.jsp at line 17 (<jsp:include is at line 17)
Trial 2
<jsp:include page="/top_links.jsp" />
Error:
File "/top_links.jsp" not found
Trial 3
<% String myUrl = request.getContextPath() + "/top_links.jsp"; %>
<jsp:include page='<%=myUrl%>' />
Error:
File "/about/top_links.jsp" not found
Please help how to include a jsp file from upper/another directory to current jsp:include. If the file is moved to current working directory then there is no error.
PS: There were many other trials that also lead to undesirable outputs.