title: Resources folder in a Java EE application
body: <p>I'm developing a simple mail sender as <strong>Java EE</strong> application.</p>
  
  <p>The project structure is shown as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/HQEZz.png" alt="Java EE app proj structure"></p>
  
  <p>To properly setup email contents, I need to read the <code>*.vm</code> files placed inside the resource folder, that I supposed to have as path <code>classpath:/templates/mail/*.vm</code> (as with <strong>Spring</strong>)... But my supposition is wrong!</p>
  
  <ol>
  <li><p>Which is the right path to use?</p></li>
  <li><p>Should I have to use the <code>META-INF</code> folder? Is this solution more
  <em>java-ee-compliant</em>? In that case, where have I to put the <code>META-INF</code> folder inside my project structure?</p></li>
  </ol>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>I packaged the project as <code>.war</code>, then I putted the files in:</p>
  
  <pre><code>/src/main/webapp/WEB-INF/classes/templates/mail/
  </code></pre>
  
  <p>Then:</p>
  
  <pre><code>org.apache.velocity.Template t = myVelocityEngine.getTemplate("classpath:/templates/mail/account_to_confirm.vm",
                      "UTF-8");
  </code></pre>
  
  <p>Nonetheless, the app returns an error at runtime:</p>
  
  <pre><code>Unable to find resource 'classpath:/templates/mail/account_to_confirm.vm'
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <hr>
  
  <p><strong>Just to better understand:</strong></p>
  
  <p>Supposing that I'd like to deploy this app as <code>jar</code> (removing the servlet class, of course): in that case, should I have to edit the folder layout in order to still use the same path into the source code?</p>