title: Saving a file with Spring MVC
body: <p>I'm running an application from within the Tomcat container. The user clicks a link and this ultimately causes a method in a helper class to create a file and save it to the file system. When this code is run from a unit test / eclipse it saves the file in the applications root directory but when this is run from the browser / in Tomcat the file is stored in Tomcat's bin directory.</p>
  
  <p>How can I find the applications root so I can choose where the save the file from there?</p>
  
  <ul>
  <li>I need to programatically find the root so this can be deployed onto other environments running tomcat.</li>
  </ul>
  
  <p>Thanks</p>