title: Java (JSP) relative path to the project
body: <p>I looking for something like of <code>request.getServletContext().getRealPath()</code> to use inside custom class (interceptor in Hibernate, which hasn't access to <code>request</code> object).</p>
  
  <pre><code>File file = new File("/photo/test.txt");
  file.delete();
  </code></pre>
  
  <p>... above code will fail, because the path of <code>file</code> is <code>/lib</code> directory of Tomcat now.</p>
  
  <p>But i need to start count from the project, not Tomcat.</p>
  
  <p>Any ideas?</p>