title: Spring MVC file not found exception
body: <p>I'm using Spring MVC. In my controller I called a function from MyClass</p>
  
  <pre><code>MyClass{
    public static void readFile(){
      File file = new FileReader("myPath/myFile.txt");
      ...
    }
    public static void main(String[] args) {
      readFile();//No problem
    }
  }
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>@Controller
  public class MyController{
    @RequestMapping(value = "/url", method = RequestMethod.GET)
    public String readFile(Locale locale, Model model) {
      MyClass.readFile();//File not found exception
      ....
    }
  }
  </code></pre>
  
  <p>The reading works when I test it in the main() of MyClass, but when I run the project on server and visit "/url", I got this:</p>
  
  <pre><code>java.io.FileNotFoundException: myPath/myFile.txt (The system cannot find the path specified)
  </code></pre>
  
  <p>How do I specify the path in the controller?</p>
  
  <p>Thank you for your time.</p>