title: How to read file in /WEB-INF/, but not in classes folder by using PathMatchingResourcePatternResolver within SpringMVC?
body: <p>Spring: 3.2.0.RELEASE</p>
  
  <p>The file i intended to read is placed at <code>/WEB-INF/resources/test.dat</code>.</p>
  
  <p>Code as below:</p>
  
  <pre><code> @javax.annotation.Resource(name = "pathMatchingResourcePatternResolver")
   private PathMatchingResourcePatternResolver resolver;
   ...
   ...
   Resource resource2 = resolver.getResource("/WEB-INF/resources/test.dat");
      try {
          File file = resource2.getFile();
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>From doc of PathMatchingResourcePatternResolver, it described: <code>and simple unprefixed paths such as "/WEB-INF/context.xml".</code></p>
  
  <p>But actually it cause an error that : <code>java.io.FileNotFoundException: class path resource [resources/test.dat] cannot be resolved to URL because it does not exist</code>.</p>
  
  <p>Does anyone know what the problem is?!</p>