title: Java/Tomcat: ServletContext & getResourceAsStream Problems
body: <p>I am trying to access a conf file (located in the WEB-INF folder) from a Tomcat web app. At the moment, I have the location of the file hard coded as a <code>String</code>. However, this does not work when the tomcat/webapps folder is in a different location than my hard coded <code>String</code> indicates. I've looked online and it seems like using the <code>getResourceAsStream ()</code> method is what I'm looking for, but I'm having a hard time getting it to work. My application is not liking it when I call the <code>getServletContext ()</code> method. Can anyone help me?</p>
  
  <p>EDIT: The relevant block of code</p>
  
  <pre><code>BufferedReader myReader = new BufferedReader (new InputStreamReader (getServletContext ().getResourceAsStream ("/WEB-INF/conf.txt")));
  </code></pre>