title: Load a static file in a Spring Controller
body: <p>I'm pretty new to Spring, so apologies if I don't see the obvious answer here. </p>
  
  <p>I set up small demo project with a Spring MVC controller and deployed it to App Engine. In my controller I would like to read the content of a static file into a String. What's the best way of doing that?</p>
  
  <p>I googled a bit but I'm probably searching for the wrong thing. I tried the below, but it does not work:</p>
  
  <pre><code>@Controller
  @RequestMapping("/myController")
  public class MyController {
  
      @RequestMapping(value = "/test", method = RequestMethod.GET)
      public @ResponseBody String myTest() {
  
          FileReader fileReader = null;
          BufferedReader bufferedReader = null;
          String content = "";
          try {
              fileReader = new FileReader("file:/WEB-INF/content/somecontent.txt");
              bufferedReader = new BufferedReader(fileReader);
              content = bufferedReader.readLine();
              bufferedReader.close(); 
          }
          catch (Exception ignored) { 
              // ignore
          }
          return content;
      }
  }
  </code></pre>
  
  <p>Any push into the right direction will be highly appreciated :-)</p>