title: JSP include error on server
body: <p>I have a jsp file in a directory and I am trying to include another file from a directory above. <strong>It works fine in localhost, but when the same file is uploaded to server I get the errors.</strong></p>
  
  <p>My Trials:</p>
  
  <p><strong>Trial 1</strong></p>
  
  <pre><code>&lt;jsp:include page="../top_links.jsp" /&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>org.apache.jasper.JasperException: An exception occurred processing JSP page /aboutus.jsp at line 17 (&lt;jsp:include is at line 17)
  </code></pre>
  
  <p><strong>Trial 2</strong></p>
  
  <pre><code>&lt;jsp:include page="/top_links.jsp" /&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>File &amp;quot;/top_links.jsp&amp;quot; not found
  </code></pre>
  
  <p><strong>Trial 3</strong></p>
  
  <pre><code>&lt;% String myUrl = request.getContextPath() + "/top_links.jsp"; %&gt;
  &lt;jsp:include page='&lt;%=myUrl%&gt;' /&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>File &amp;quot;/about/top_links.jsp&amp;quot; not found
  </code></pre>
  
  <p>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.</p>
  
  <p>PS: There were many other trials that also lead to undesirable outputs.</p>