title: How to list contents of a server directory using JSP?
body: <p>When writing a JSP file, how can I get the <strong>current directory</strong> of this file at runtime<br>
  (to be able to iterate the directory and list its contents)?</p>
  
  <p>Would some file I/O operations be restricted because of some security issues?</p>
  
  <p><em>I would prefer a solution without accessing some implementation-specific
  server variables / properties.</em></p>
  
  <p><strong>EDIT:</strong><br>
  I wouldn't ask if it were as simple as <em><code>new File(".")</code></em>, because this would just give the directory of server's executables.</p>