title: Velocity engine unable to find resource
body: <p>In my application user can receive email templates. I'm using <code>velocity engine</code> for sending emails. Email templates are located in the <code>WEB-INF/email_tempaltes/...</code> directory. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>String body = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, templateLocation, "UTF-8", model);
  </code></pre>
  
  <p>Where <code>templateLocation</code> is <code>String variable</code> which obvious looks something like this:</p>
  
  <pre><code>"/email_templates/request-feedback.vm"
  </code></pre>
  
  <p>Here is how I send mails:</p>
  
  <pre><code>private void sendEmail(final String toEmailAddresses, final String fromEmailAddress,
                             final String subject, final String attachmentPath,
                             final String attachmentName, final Mail mail, final String templateLocation) {
          Properties properties = new Properties();
          MimeMessagePreparator preparator = new MimeMessagePreparator() {
              public void prepare(MimeMessage mimeMessage) throws Exception {
                  MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8");
                  message.setTo(toEmailAddresses);
                  message.setFrom(new InternetAddress(fromEmailAddress));
                  message.setSubject(subject);
                  Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;();
                  model.put("phone", mail.getPhone());
                  model.put("email", mail.getEmail());
                  model.put("message", mail.getMessage());
                  String body = VelocityEngineUtils.mergeTemplateIntoString(
                          velocityEngine, templateLocation, "UTF-8", model);
                  message.setText(body, true);
                  if (!StringUtils.isBlank(attachmentPath)) {
                      FileSystemResource file = new FileSystemResource(attachmentPath);
                      message.addAttachment(attachmentName, file);
                  }
              }
          };
          this.mailSender.send(preparator);
      }
  </code></pre>
  
  <p>I tested email sending on my local machine and it works fine, but when i deployed it on the server i got an exception:</p>
  
  <pre><code>org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource /email_templates/request-feedback.vm'
  </code></pre>
  
  <p>How can I fix it? Where should I store email templates? Thanks in advance!</p>
  
  <p><strong>-----------EDITED:-----------</strong>
  I've created classes directory ander WEB-INF and have added my templates there. </p>
  
  <p>And now I get template like this:</p>
  
  <pre><code>emailSender.sendEmail(mail.getEmail(), "info@somemail.com", "Your message was sent successfully", mail, "/classes/templates/request-sent-answer.vm");
  </code></pre>
  
  <p>And get the same error: </p>
  
  <pre><code>Could not prepare mail; nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 
  </code></pre>