title: Get path to directory from Spring bean?
body: <p>I have what seems like a simple problem.  I have a Spring web app, deployed in Tomcat.  In a service class I want to be able to write a new file to a directory called graphs just under my application root:</p>
  
  <pre><code>/
     /WEB-INF
     /graphs/
     /css/
     /javascript/
  </code></pre>
  
  <p>My service class is a Spring bean, but I don't have direct access to ServletContext through the HttpServlet machinery.  I've also tried implementing ResourceLoaderAware but still can't seem to grab a handle to what I need.</p>
  
  <p>How do I use Spring to get a handle to a directory within my application so that I can write a file to it?  Thanks.</p>